Question: Can you please help me solve this problem because I am not understanding it Part 2 Requirements: Write a script that will determine which file
Can you please help me solve this problem because I am not understanding it
Part 2 Requirements:
Write a script that will determine which file in a directory has the maximum number of lines (this may be different than the file that has the maximum number of bytes). After determining the file with the maximum number of lines, the script will print out the name of the file and the number of lines. The script should only focus on files and ignore sub directories. Research the wc command options under the manual online documentation.
The maxlines.sh script is designed to handle zero (0) or one (1) argument(s). o If zero arguments are specified, the script by default will examine the files in the current directory. o If one argument is specified, the argument must be a valid directory name. The script will then examine the files in the specified directory.
The script should be able to handle the following error conditions: o More than 1 argument is specified o The specified argument is not a directory.
The script must be able to execute on cs.franklin.edu machine
The script file name must be: maxlines.sh The script must be located in $HOME/itec400/homework
Make sure the permissions on the your itec400 directory are 705
Make sure the permissions on your script are 705
Sample Output
Sunny Day Scenarios
(note: output depends on current directory and may not match the values below): > maxlines.sh File maxlines.sh has maximum number lines ( 36 lines). At the system prompt (>), enter the following on command line: maxlines.sh /export/home/dandrear/public_html/itec400/Misc/small_passwd File small_passwd has maximum number lines ( 7 lines). Rainy Day Scenarios: > maxlines.sh junk error: argument must be a directory usage: maxlines.sh [directory] > maxlines.sh junk trash error: can only use 0 or 1 arguments. usage: maxlines.sh [directory]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
