Question: Problem 1 Write a shell script whose single command line argument is a directory. Your script should perform the following: - If you run the
Problem
Write a shell script whose single command line argument is a directory. Your script should perform the following:
If you run the program with more than one argument or no argument, the script should display an appropriate message.
If you run the script with a directory, the script should display the name of each subdirectory in that directory.
If the command line argument is not a directory, the script should display an appropriate message.
Note: your script should not prompt the user to enter a directory. It should be executed with arguments.
Save the script as problemshin the assignment directory.
Problem
Write a shell script whose single command line argument is a directory. Your script should perform the following:
If you run the program with more than one argument or no argument, the script should display an appropriate message.
If you run the script with a directory, the script should display the name and type of each item in that directory.
If the command line argument is not a directory, the script displays an appropriate message.
Sample output if the argument is a directory:
Name: Documents Type: directory
Name: shsh Type: regular file
Save the script as problemsh in the assignment directory.
Problem
Write a shell script whose single command line argument is a directory. Your script should perform the following:
If you run the program with more than one argument or no argument, the script should display an appropriate
message.
If you run the script with a directory, the script should display the number of subdirectories and the number of
regular files in that directory.
If the command line argument is not a directory, the script should display an appropriate message.
Sample output if the argument is a directory:
Number of subdirectories: Number of regular files:
Save the script as problemsh in the assignment directory.
Problem
Write a shell script whose single command line argument is a directory. Your script should perform the following:
If you run the program with more than one argument or no argument, the script should display an appropriate
message.
If you run the script with a directory, the script should display the number of empty files in that directory.
If the command line argument is not a directory, the script should display an appropriate message.
You may use the touch command to create empty files for testing.
Syntax: touch filename
Save the script as problemsh in the assignment directory.
help with scripting and what to type to get outputs???
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
