Question: Example Output $ ./workwithfiles 3.sh Spot Max Lassie Rover Snoopy Misty Felix Fluffy Kimba Tom Mortimer Tigger Misty Felix Fluffy Kimba Tom Mortimer Tigger Sassy

 Example Output $ ./workwithfiles 3.sh Spot Max Lassie Rover Snoopy MistyFelix Fluffy Kimba Tom Mortimer Tigger Misty Felix Fluffy Kimba Tom Mortimer

Example Output $ ./workwithfiles 3.sh Spot Max Lassie Rover Snoopy Misty Felix Fluffy Kimba Tom Mortimer Tigger Misty Felix Fluffy Kimba Tom Mortimer Tigger Sassy Lucy $| Directions Using the following guidelines, create a Bash program. 1. You will be using the CPT180Stuff folder from Chapter 8 for this assignment. 2. Create a Bash program named workWithFiles3.sh 3. Add three comment fines at the top of the program that contain: a. Program Name b. Program Description C. Programmer's Name (You) 4. Write code that will do the following: a. Using an if statement, determine if both the dognames.txt file and the catnames.txt file exist. If both files exist, the program should complete steps b-e below. If either file does not exist, the program should print out the message "Unable to access one or more files". b. Print the contents of the dognames.txt file. C. Print the contents of the catnames.txt file. d. Add two cat names to the catnames.txt file. You can pick the names. The example output below shows the names Sassy and Lucy added. e. Print the contents of the catnames.txt file. 5. Submit the workWithFiles3.sh file into the Bash Assignment Submission Folder. Hints 1. The echo command when used to append to a file adds a newline after the item is appended. 2. When using Cygwin, you can access the Windows drives by using the cygdrive device. For example, if your CPT180Stuff folder is located in the root directory of the E drive, you could access the dognames.txt file from your Bash program by using the path: /cygdrive/e/cpt180stuff/pets/dogs/dognames.txt

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To create the Bash script workWithFiles3sh follow the guidelines provided Heres a stepbystep solutio... 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 Databases Questions!