Question: Write a script that takes one command line argument, the name of a text file which contains a number of file names. The script should

Write a script that takes one command line argument, the name of a text file which contains a number of file names. The script should use a loop to go through these file names and for each filename check if it exists in the filesystem. If the file does not exist, the script will print that the file does not exist (exact format shown below ). If the file does exist, the script will print whether it is a directory or an ordinary file (non-directory).
Assume that the file given contains:
hello.txt /usr/share/dict
CS136
CS136/hello.c
Expected usage:
./script.sh given
Expected output:
hello.txt does not exist
/usr/share/dict is a directory
CS136 is a directory
CS136/hello.c is an ordinary file
 Write a script that takes one command line argument, the name

Write a script that takes one command line aggument, the name of a text file which contains a number of file rames. The script should use a loop to go through these file names and fer each fliename theck if it exists in the filesystem. If the file does not exist, the script will print that the file does not exist (exact format shown below if the fie does exist the seript will print whether it is a directory or an ordinary file inon-directory). Assume that the file given cortains: helio. tict / unt/inaro/alot cos13e casise/helis,e Expected issege: iaeription giveh Expected ovitput helio.tixt deen not exist faglahare/diet is a directory cos36 is a directory calldhelle,e is an erdinaty file

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!