Question: Write a shell script that accepts two file extensions as command line arguments and renames all files with the first extension within the current working
Write a shell script that accepts two file extensions as command line arguments and renames all files with the first extension within the current working directory to have the second extension instead.
For example:
$ reextend .log .txt
Would cause install.log to be renamed to install.txt, and
$ reextend A B
Would cause TADAA to be renamed to TADAB . It would also cause file.A to be renamed file.B .
The script should print out error messages as is appropriate if there is any problem with the command line arguments. Test the script with a range of different parameters, including incorrect parameters or missing parameters. hint: See Parameter Expansion in the bash man or info page.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
