Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started