Question: CPT 1 8 0 Bash Assignment Directions Using the following guidelines, create a Bash program. 1 . You will be using the CPT 1 8
CPT Bash Assignment
Directions
Using the following guidelines, create a Bash program.
You will be using the CPTStuff folder from Chapter for this assignment.
Create a Bash program named workWithFilessh
Add four comment lines at the top of the program that contain:
a Program Name
b Program Description
c Programmer's Name You
d Current Date
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.
At the end of your code, using comment lines, answer the following question:
a In Bash, what are the six indicators that can be used to check for file attributes? What does
each one check for?
Submit the workWithFilessh file into the Bash Assignment Submission Folder.
NotesHints
The echo command when used to append to a file adds a newline after the item is appended.
DO NOT use the BASH environmental variable IFS in this assignment. It is not covered in this course
and is not necessary for this code.
When using Cygwin, you can access the Windows drives by using the cygdrive device. For
example, if your CPTStuff 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:
cygdriveecptstuffpetsdogsdognamestxt
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
