CSCI 243 Project #1

File Renaming

 

Date Due: 15 September 2014

 

Digital cameras usually store images in very boring names such as PICT0001.jpg, PICT0002.jpg, and so on.  This doesn’t help you later when you are looking for a particular picture.  Often people will take a group of pictures at an event, download them, and then clear the camera before the next event.  It would be much nicer if the pictures were named something like GRAD0001.jpg, GRAD0002.jpg, etc instead of the more generic PICT.  Write a shell script to take three parameters from the command line, two strings and a file suffix, and change the names of all files in the current directory that are named with the first string, followed by some numbers, a period, and then file suffix into names that consist of the second suffix, the same number, and the same file suffix.  Create a directory of empty files to test it on.  Turn in your shell script, and a listing of the test directory before and after you run your script.