Sei sulla pagina 1di 1

Center for Development of Advance Computing

Linux Lab Assessment

1 Write a shell script which is to be executed with one argument and which will
display an error message if argument is not entered or more than one argument is
entered at the command line
Check if the argument is a directory fi le and display message directory fi le if it is.
Else display ordinary fi le.
(15)

2) Devise wild card patterns to match all filenames comprising at least 3 chars
1) Where 1st char is numeric and last is not alphabetic.
2) Containing chap as an embedded string, except at the beginning or end.
10

3) How do the commands wc foo and wc < foo differ? Who opens file in each case?
5
4) Write a shell script that accepts a filename as argument and displays
1)
its size
2)
Whether it is readable or writable or both
, If the file exists and a suitable message if the file does not exists.
5) Explain the output fields of the ps command
6) Write shell script to list all running processes repeatedly at an interval of 30 seconds
7) Write shell script for the displaying following pattern, with number of levels provided by
the user:
10
*
*

*
*

*
*

*
*

*
7

Potrebbero piacerti anche