XO BQ Quiz Instructionis There 8 fill-in-blanks questions, 5 pts per question, and 4 programming questions,...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Answer rating: 100% (QA)
binbash Check if a directory name is provided as a commandline argument if ne 1 then echo Usage 0 ex... View the full answer
Related Book For
Basic Technical Mathematics
ISBN: 9780137529896
12th Edition
Authors: Allyn J. Washington, Richard Evans
Posted Date:
Students also viewed these programming questions
-
How can i prepare in Android studio a survey application to be used by surveyors. The interviewer will ask the questions via the mobile application. The survey will be a question entry section and...
-
Prove the following functions are primitive recursive: Quotient of two numbers: if x, y = N then quo(x, y) = such that x = y*z+r where 0 r
-
What functions are there in the mazeAsn4 module: print_maze(maze) Description: This function displays the maze. The accessible cells are labelled G i.e. green, the blocked cells are labelled R i.e....
-
Which of the following is not true regarding a promissory note? a. Promissory notes may not be transferred to another party by endorsement. b. Promissory notes may be sold to another party. c....
-
Supersonic airflow takes a 5° expansion turn, as in Fig. P9.141. Compute the downstream Mach number and pressure and compare with small-disturbance theory. Ma, 3 p,#100 kPa , P2 5
-
Enumerate methods of qualitative and quantitative forecasting. What are the major differences between the two?
-
An oil company is offered a lease of a group of oil wells on which the primary reserves are close to exhaustion. The major condition of the purchase is that the oil company must agree to undertake a...
-
The following data come from the financial records of Bynum Corporation for 2011. Required How many times was interest earned in 2011? Sales Interest expense Income tax expense Net income $840,000...
-
Transactions for common stock and trading investmentsZeus Investments Inc. is a regional freight company that began operations on January 1 , 2 0 Y 8 . The following transactions relate to trading...
-
? Dean and Ellen Price are married and have a manufacturing business. They bought a piece of business equipment (7-year personal property) on 4/1/2017 for $50,000. Use half-year convention to...
-
QUESTION 12 Brown Company's bank statement for September 30 showed: Bank statement balance $4,210 $6,560 Book balance of cash The following information was also available as of September 30: a. A...
-
Consider the following two dimensional problem: J-V (a(z)Vu(x)) +u(x) = f(x) 8, u(r) = 0 nC R is a bounded domain, / and a are smooth functions with a(z) 2 ao 20 for all z e ft. a) Define the weak...
-
1. What is the pricing strategy of CANADIAN TIRE in terms of LEGAL consideration? 2. Make two recommendations on how the current setting prices of Canadian Tire could change.
-
Explain how concept of confidence or overconfidence may affect financial decision.
-
Please explains in details in terms of Operating System as follows: a. Unix file system ? b. superblocks, inode, magic number ?
-
Describe the economic climate relating to financial services industry. (In your answer, think about the impact a stagnating economy has on the financial services industry. Refer to economic...
-
Suppose your firm has $500,000 in liabilities and $1,500,000 in assets. You find out that the duration of assets is 6.4 years and the duration of liabilities is 4.5 years. The interest rate is...
-
State whether each statement is true or false. If false, give a reason. {purple, green, yellow} = {green, pink, yellow}
-
In Example 1, change the before the 2y 2 to + and then determine what type of curve is represented. Data from Example 1 The equation 2x 2 = 3 2y 2 represents a circle. This can be seen by putting...
-
A point on a cam is 8.30 cm from the center of rotation. The cam is rotating with a constant angular velocity, and the vertical displacement d = 8.30 cm for t = 0 s. See Fig. 10.37. Sketch two cycles...
-
Display the graphs of the given functions on a graphing calculator. Use appropriate window settings. y = 3 + 2 X
-
Let \(X_{1}, X_{2}, \ldots, X_{5}\) be 5 independent random variables. Find the moment generating function \[M_{\sum X_{i}}(t)=E\left(e^{t\left(X_{1}+X_{2}+\cdots+X_{5} ight)} ight)\] of the sum when...
-
Let \(X_{1}, X_{2}\), and \(X_{3}\) be independent normal variables with \[\begin{array}{lll}E\left(X_{1} ight)=5 & \text { and } & \sigma_{1}^{2}=9 \\E\left(X_{2} ight)=-2 & \text { and } &...
-
Refer to Exercise 6.36. (a) Show that \(2 X_{1}-X_{2}-4 X_{3}-12\) has a normal distribution. (b) Find the mean and variance of the random variable in part (a). Data From Exercise 6.36 6.36 Let X1,...
Study smarter with the SolutionInn App