Unix Lab1
Unix Lab1
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:
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:
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: