Você está na página 1de 2

UNIX LAB PROGRAMS

1) Write a shell program to print number of arguments and process id.

2) Write a non-recursive shell script which accepts any number of argument


and prints them in the reverse order.

3) Write a shell script that accepts two file names as arguments and and
checks if the permissions of these files are identicle and if the permissions
are otherwise output each file followed by its permissions.

4) Write a shell to accept date as an argument and display a mess according


to date.

5) Write a shell script to print reverse of a number.

6) Write a shell script which accepts command line arguments and checks
whether it is a valid login name or not if it is print login name and home
directory.

7) Write a shell script that prints if the given string is a palindrome or not.

8) Write a shell program which accepts command line arguments & create
directories in hierarchical order.

9) Write a shell script to determine number of links of filename as command


line arguments.

10) Create a script file called FILE PROPERTIES that reads a file name entered
and outputs its properties.

11) Write a shell script that accepts one or more file name as arguments and
converts it into uppercase, provided they exist in current directory.

12) Write a shell script that accepts file name as an argument and displays its
creation time if the filename doesnot exist outputs error.

13) write a shell script to display the calendar for current month with current
date replaced by
* and ** depending on whether the date has one digit or two digit.

14) write a shell script to find smallest of three numbers that are read from
keyboard.

15) write a shell script using 'expr' command to read in a string and display a
suitable message if it does not have atleast 10 characters.

16) write a shell script to compute sum of number passed to it as argument in


command line and display the results.

17) write a shell script that compute gross salary of an employee ,according
to rule given below. If basic salary is <15000 then HRA is 10% of basic and
DA is 90% of basic else if basic salary is >= 15000 then HRA=50% of basic
and DA is 98% of basic.

18) Write a shell script that deletes all the lines containing a specific word in
one or more file supplied as argument to it.

19) Write a awk script to compute gross salary of an employee according to


rule given below. If basic salary is <10000 then HRA is 15% of basic and DA
is 45% of basic. If basic salary is >= 10000 then HRA=20% of basic and DA is
50% of basic.

Você também pode gostar