Answered step by step
Verified Expert Solution
Question
1 Approved Answer
XO BQ Quiz Instructionis There 8 fill-in-blanks questions, 5 pts per question, and 4 programming questions, 15 pts per question. Question 12 Write a
XO BQ Quiz Instructionis There 8 fill-in-blanks questions, 5 pts per question, and 4 programming questions, 15 pts per question. Question 12 Write a Bash script that performs the following tasks: 1. Accept a directory name as a command-line argument. Check if the directory exists, if not, print a message and exit. 2. Traverse the directory recursively and for each file found, check if it is a text file. You can assume that all text files have the extension .txt. 3. For each text file, count the number of lines that are either empty or consist only of spaces. 4. Keep a running total of such lines (i.e., those that are empty or contain only spaces) found across all text files processed. 5. After all text files have been processed, print the total count of lines that are either empty or contain only spaces. Edit Format Table 12pt v Paragraph BIUAv2v T v 15 pts ww O : D Question 6 Question 7 Question B Question 9 Question 10 Question 1 Question Time Running: H Attempt due: Jun 13 38 Minutes, 54
Step by Step Solution
There are 3 Steps involved in it
Step: 1
binbash Check if a directory name is provided as a commandline argument if ne 1 then echo Usage 0 ex...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