Q. Write a script that behaves both in interactive and non interactive mode. When no arguments are supplied it picks up each C program from the directory and prints first 10 lines.
It then prompts for deletion of the file.
If user supplies arguments with the script , then it works on those files only.
-
-
-
-
-
-
-
-
-
-
- -- - - - - - - - - - - - - - -
-
-
-
-
-
-
-
-
-
The main problem Im facing with this question is how to make the program pick up a C program in case no arguments are specified .
Code :
ls -lrt *.C
Please elaborate it .