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

(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

1 Expert Approved Answer
Step: 1 Unlock

Heres a sample bash script that fulfills the requirements binbash Check if ther... View full answer

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 Programming Questions!