Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Creating this bash script that will be working along with a main menu if the user presses the C key it creates a new photo

image text in transcribed

Creating this bash script that will be working along with a main menu if the user presses the C key it creates a new photo item following the steps above. really need help working with this script

image text in transcribed

Example data that can be used to create a new photo item.

a. C: Create a new photo item i. From the terminal, prompt for the following fields, one at a time, each on its own line: 1. Photo number: such as 23 (must be in the range 1 to 99999). 2. Photo file location: such as /home/bk1740/temp/pic1.jpg. If it does not exist, print an error message and ask again. 3. Photo year: such as 2021 (must in the range 1950 to 2050) 4. Photo month: such as 1 (must be from 1 to 12) 5. Photo day: such as 30 (must be from 1 to 31) 6. Photo location: such as Sydney, Australia (required) 7. Photo names: such as Nicole Kidman, Hugh Jackman (optional) ii. Validate that the photo number is unique before asking for the photo file. If not, print the error "p.photo already exists" and return to the main prompt, where is the photo number above. iii. If the year, month or day is out of range, print an error message like "Month 25 is not in the range 1 to 12" and continue asking for it until it is range. iv. Create the data directory if it does not exist (see below). v. Using the values entered by the user, create a new file in the data subdirectory. vi. Update data/queries.log by adding a CREATED line entry. 101 samples/pic12.jpg 2021 2 20 Paris Joe Montana 102 1999 1 3 London Thor, Hulk r 102 samples/pic12.jpg 1800 2200 2000 0 13 6 0 32 15 r 102 101 102 samples/pic23.png 2004 12 31 New York Mario, Luigi d 101 r 102 x 0 100000 50 noway Rome, Italy bob, joe R 423 R 50 D 3838 D 50 Q r 102 2 u a. C: Create a new photo item i. From the terminal, prompt for the following fields, one at a time, each on its own line: 1. Photo number: such as 23 (must be in the range 1 to 99999). 2. Photo file location: such as /home/bk1740/temp/pic1.jpg. If it does not exist, print an error message and ask again. 3. Photo year: such as 2021 (must in the range 1950 to 2050) 4. Photo month: such as 1 (must be from 1 to 12) 5. Photo day: such as 30 (must be from 1 to 31) 6. Photo location: such as Sydney, Australia (required) 7. Photo names: such as Nicole Kidman, Hugh Jackman (optional) ii. Validate that the photo number is unique before asking for the photo file. If not, print the error "p.photo already exists" and return to the main prompt, where is the photo number above. iii. If the year, month or day is out of range, print an error message like "Month 25 is not in the range 1 to 12" and continue asking for it until it is range. iv. Create the data directory if it does not exist (see below). v. Using the values entered by the user, create a new file in the data subdirectory. vi. Update data/queries.log by adding a CREATED line entry. 101 samples/pic12.jpg 2021 2 20 Paris Joe Montana 102 1999 1 3 London Thor, Hulk r 102 samples/pic12.jpg 1800 2200 2000 0 13 6 0 32 15 r 102 101 102 samples/pic23.png 2004 12 31 New York Mario, Luigi d 101 r 102 x 0 100000 50 noway Rome, Italy bob, joe R 423 R 50 D 3838 D 50 Q r 102 2 u<><><><>

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

Step: 3

blur-text-image

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 Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions

Question

Explain the advantages and limitations ofIRR in capital budgeting.

Answered: 1 week ago