0% found this document useful (0 votes)
35 views

Unix Lab1

Uploaded by

nnm22is026
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

Unix Lab1

Uploaded by

nnm22is026
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

1.

DEMONSTRATION OF SIMPLE SHELL PROGRAM

Output:
2. Write a shell program to find and display largest and smallest of three number

Output:

3. Write a shell program to check the number n is divisible by m or not. Where m and n are
supplied as command line argument or read from key board interactively.
a)
Output:

b)

Output:

4. Implement a shell program to search a pattern in a file that will take both pattern and file
name from the command line arguments
a)

Output:

b)
Output:

5. Write a shell program to implement simple calculator


6. Shell script that accepts path names and creates all the components in that path names as
directories. For ex, if the script name is mpe, then the command mpe a/b/c/d should create
directories a, a/b, a/b/c, and a/b/c/d

Output:

7. Write a shell program that takes two file names checks the permission for the files are
identical and if they are identical output common permission otherwise output each file
name followed by its permission
8. Develop a shell script that performs the following string handling operations
1)calcaulate the length of the string
2)locate the position of first 3 characters of the string
3)locate the position of last 3 characters of the string
4)position of character in string
Output
9. Write a shell script that accepts filename as arguments. For every filename, it should first
check whether it exists in the current directory and then convert its name to uppercase, but
only if a file with new name doesnt exist

Output:

10. Write a shell program that takes any number of arguments and print them in same order and
in reverse order with suitable messages
Output:

12 write an awk program to provide extra spaces at end of the line(if requested) so that the line
length is maintained as 15
13. Write a awk script that folds long line into 40 columns. Thus any line that exceeds 40
characters must be broken after 40th and is to be continued with the residue. The inputs to be
supplied through a text file created by the user

Output:
14. Design an Awk script to delete duplicated lines from a text file. The order of the original must
remain unchanged.

Output:

15.perl program to check if a given file is binary or not


output

16. PERL program to find the sum of digits of an unsigned number passed through argument.
Output:

17. Write a PERL program that prompts user to input the string and a number, and prints the
string that many times, with each string on separate line

OUTPUT
18.Perl script that echoes its command line argument one per line after translating all lowercase
letters to uppercase

Output:

You might also like