Question: Write a bash shell script which takes two command line arguments. The first command line argument is the name of a directory to make. The
Write a bash shell script which takes two command line arguments. The first command line argument is the name of a directory to make. The second argument is a number. The script should make that directory, then fill it with files named file_#, where # is every number between 0 and the second argument.
Important new commands:
mkdir name -> make the directory name
touch file -> make the file called file
Write a bash shell script that takes an integer number between 0 and 100 (i.e score) as its single command line argument. The script should output a letter based on the following criteria:
If score is between 90 and 100, output letter A.
If score is between 80 and 89, output letter B.
If score is between 70 and 79, output letter C.
If score is between 60 and 69, output letter D.
Otherwise, output letter F.
C Command-Line Arguments and File I/O. Write a program (i.e., a main function) that takes one command-line argument, an integer, and writes out to a file counting.txt the numbers from 1 through the integer, one on each line. For example, if the command-line argument was 5, then the program should write to counting.txt the lines
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
