Question: Write a bash shell script which takes two command line arguments. The first is a control flag and the second should be the name of
Write a bash shell script which takes two command line arguments. The first is a control flag and the second should be the name of a .txt file. Using a function you write for carrying out each option: If the control flag is cow, lolcat and cowsay the contents of the file If the control flag is fdata, the function should prompt the user for string data, read that data in, and then IF the data is 10 or more characters long, print it to the file (can append or overwrite) If the control flag ddata, the function should list the contents of the directory IF the file is a directory and echo Not a directory otherwise
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
