Question: Write a script that will take an argument a file that has a list of filenames. For each file, print whether the file is a

Write a script that will take an argument a file that has a list of filenames. For each file, print whether the file is a directory, an empty file, or something else. It should have two optional arguments i will ignore empty files, and s will print out a sum of how many files of each type were found. Hint: You can use awk {print $2} to print out the second column of output. Hint: [[ ! ( -f "$file_to_read" ) ]] checks if your file in file_to_read is an actual file Hint: [[ ! ( -e $filename ) ]] checks if a filename exists (true if doesn't) Add error handling quit with error if passed in an invalid file, print out doesnt exist for line that point to files that dont exit, and sum should display how many of the lines werent a 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!