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

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter9: Sequential Access Files And Menus
Section: Chapter Questions
Problem 1RQ: Which of the following opens the employ.txt file and allows the computer to write new data to the...
icon
Related questions
Question

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

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Linux
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L