Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CPT 180: Shell Scripting I need some help/tutor on how to begin this. I have read part of the Automate the Boring Stuff with Python

CPT 180: Shell Scripting

I need some help/tutor on how to begin this. I have read part of the "Automate the Boring Stuff with Python" book (2nd Edition). If you can help guide me on what pages it associates with so I can learn how to do it step by step.

image text in transcribedimage text in transcribed

CPT 180 Bash Assignment 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 lines 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 workWith Files 3.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 chuck@DESKTOP-SNI6089 $ ./workwithfiles 3.sh Spot Max Lassie Rover Snoopy Misty Felix Fluffy Kimba Tom Mortimer Tigger Misty Felix Fluffy Kimba Tom Mortimer Tigger Sassy Lucy chuck@DESKTOP-SNI6U89 ~ $ |

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David M. Kroenke

12th Edition International Edition

1292023422, 978-1292023427

More Books

Students also viewed these Databases questions

Question

7. Why may connict be good or bad for an organization'!

Answered: 1 week ago

Question

1. Traditional and modern methods of preserving food Articles ?

Answered: 1 week ago

Question

What is sociology and its nature ?

Answered: 1 week ago

Question

What is liquidation ?

Answered: 1 week ago

Question

Explain the different types of Mergers.

Answered: 1 week ago

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago