The DOS Rename command allows file suffixes to be changed so
The DOS Rename command allows file suffixes to be changed so that: ren c *.cpp changes all files with suffixes .c to the suffix the name with .cpp. So a c is renamed a cpp; b.c is renamed b.ccp...for all files in the path Write a bash shell script that takes the destination path (directory dest as an optional parameter and renames all files in dest or current directory with old extension to new extension. The format is S proj3 [dest] old extension new extension It should query the user about each file before r (y or n skip if n (or no Example: Suppose files a.c b.c in the directory./dest A sample execution would be Sproj3 dest c cpp rename a c? (y/n)y rename b.c? Cy/n) n. finshed Sls dest should include a cpp b.c If no destination is provided, assume the current working directory is the destination which includes files a c, b.c
Solution
The script takes the following inputs:
\'path\' is the absolute path of the parent folder, and
\'foldername.txt\' is a text file which contains the names of the subdirectories under each of which the specific directory has to be renamed.
Now save the script with any name of your choice and run it from the terminal to see it do what it was made to do. :
displaying error message:
