Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PracticeExercises-Wildcards.pdf + X File Edit View Go Bookmarks Help 1 of aa- Exercise 1 Thumbnails Write a shell script that renames al files in the

image text in transcribed

PracticeExercises-Wildcards.pdf + X File Edit View Go Bookmarks Help 1 of aa- Exercise 1 Thumbnails Write a shell script that renames al files in the current directory that end in "jpg" to begin with today's date in the following format: YYYY-MM-DD. For example, if a picture of my cat was in the current directory and today was October 31, 2016 it would change name from "mycat.jpg" to "2016-10-31-mycat.jpg Hint: Look at the format options to the date command. For "extra credit" make sure gracefully handle instances where there are no "jpg" files in the current directory. (Hint: Man bash and read the section on the nullglob option.) Exercise 2: Write a script that renames files based on the file extension. The script should prompt the user for a file extension. Next, it should ask the user what prefix to prepend to the file name(s). By default the prefix should be the current date in YYYY-MM-DD format. So, if the user simply presses enter the date will be used. Otherwise, whatever the user entered will be used as the prefix. Next, it should display the original file name and the new name of the file. Finally, it should rename the file

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

Oracle 10g Database Administrator Implementation And Administration

Authors: Gavin Powell, Carol McCullough Dieter

2nd Edition

1418836656, 9781418836658

More Books

Students also viewed these Databases questions