Question: (b) Write a bash script which: Has at least two command line arguments. If there are less than 2 command line arguments provided then
(b) Write a bash script which: Has at least two command line arguments. If there are less than 2 command line arguments provided then an error message should be output. The first command line argument should represent the name of a directory in the users home area. If the directory doesn't exist, it should be created by the script. The remaining command line arguments should be the names of files. If any of the remaining command line arguments are not files then an error message should be output. If no errors in the command line were detected, the script should move each of the files specified to the directory specified in the first command line argument. . .
Step by Step Solution
There are 3 Steps involved in it
Heres a sample bash script that fulfills the requirements binbash Check if ther... View full answer
Get step-by-step solutions from verified subject matter experts
