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
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