Answered step by step
Verified Expert Solution
Link Copied!

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
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Linked Data A Geographic Perspective

Authors: Glen Hart, Catherine Dolbear

1st Edition

1000218910, 9781000218916

More Books

Students also viewed these Databases questions

Question

3 The distinction between microeconomics and macroeconomics.

Answered: 1 week ago

Question

2 The role of economic theory in economics.

Answered: 1 week ago