Please help me answer the shell script

Closed
luk - Aug 29, 2009 at 01:21 AM
jipicy Posts 40842 Registration date Wednesday August 27, 2003 Status Moderator Last seen August 10, 2020 - Aug 29, 2009 at 03:16 AM
Hello, this is my question about shell script

1. Write a script that asking for a filename using read command. If the file exist, list number of words and number of line of text in the file.


2. Modify the above script so that the filename is given as parameter. (for example the script can be run as “countwordnline myfile”)

3. Write a script that lists the number of ordinary files and directories for a given directory. Do this in two ways:-

a. Use the first letter of the output of ls –l to determine a file’s type.
b. Use the file type condition tests to determine a file’s type.

4. Write a script that takes the name of a directory as an augment and searches the file hierarchy rooted at that directory for zero-length files. Write the names of all zero-length files to standard output. If there is no option on the command line, have the script delete the file after displaying its name, asking the user for confirmation, and receiving positive confirmation. A –f (force) option on the command line indicates that the script should display the filename but not ask for confirmation before deleting the file.

1 response

jipicy Posts 40842 Registration date Wednesday August 27, 2003 Status Moderator Last seen August 10, 2020 17
Aug 29, 2009 at 03:16 AM
Hi,

this is my question about shell script
No, this is a homework!
Please post what you made and we shall help you with pleasure...

;-))
0