Write complete bash script that provides a menu to either double-space an input file or triple space an input file. Use the read command to obtain the users choice and then perform the requested operation. For double spacing, the script will ask for an input file and then read each line of the input file. For each line read, it then writes the line back to another file, but with an extra blank line following. This has the effect of double spacing the file. Include all necessary code to check if the read command gets the necessary filename, and whether the specified file exists. If so, continue with the double spacing, if not state that the filename was blank or does not exist and end the script. For triple spacing, the script will ask for an input file and then read each line of the input file. For each line read, it then writes the line back to another file, but with two extra blank lines following. This has the effect of triple spacing the file. Include all necessary code to check if the read command gets the necessary filename, and whether the specified file exists. If so, continue with the triple spacing, if not state that the filename was blank or does not exist and end the script. Use while loops, if statements and test file operators. (Usage: spacin
Write complete bash script that provides a menu to either double-space an input file or triple space an input file. Use the read command to obtain
the users choice and then perform the requested operation.
For double spacing, the script will ask for an input file and then read each
line of the input file. For each line read, it then writes the line back to
another file, but with an extra blank line following. This has the effect of
double spacing the file. Include all necessary code to check if the read
command gets the necessary filename, and whether the specified file
exists. If so, continue with the double spacing, if not state that the filename
was blank or does not exist and end the script.
For triple spacing, the script will ask for an input file and then read each line
of the input file. For each line read, it then writes the line back to another
file, but with two extra blank lines following. This has the effect of triple
spacing the file. Include all necessary code to check if the read command
gets the necessary filename, and whether the specified file exists. If so,
continue with the triple spacing, if not state that the filename was blank or
does not exist and end the script. Use while loops, if statements and test file operators. (Usage: spacingFile.sh
Step by step
Solved in 2 steps