Question: 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

 Creating this bash script that will be working along with a

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

main menu if the user presses the C key it creates a

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

1 Expert Approved Answer
Step: 1 Unlock 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!