Question: (a) Write a simple shell script that takes as a single argument the name of a directory. The script loops through all the files in

 (a) Write a simple shell script that takes as a single

(a) Write a simple shell script that takes as a single argument the name of a directory. The script loops through all the files in the current directory (assumed different to the directory whose name is given as the argument), uses wc to count the words in each file and saves that count in a file in the directory specified by the argument, with the name of that file having a ".wc" appended to the original filename. You may assume the named directory has a complete path and exists. You may use Is. You may assume the current directory has just ordinary files - no sub-directories. (b) Modify your answer of the previous part to cater for the existence of sub-directories of the current directory (you are to simply ignore them). (c) Write a script that takes a parameter n (a number) and lists the names of the n most-recently-modified files in the current directory. (d) Given a file named "dashes", in the current directory, with contents: d-d What will this print? echo "This is some text" | cat dashes - dashes Explain

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!