Question: Write a Bash script called move that could replace the UNIX command mv. 'move' tries to rename the source file (using the UNIX command mv),
Write a Bash script called move that could replace the UNIX command mv. 'move' tries to rename the source file (using the UNIX command mv), but if the destination file exists, appends an index number, a sort of version number, to the destination file. So if the user types:
move a.txt b.txt
and b.txt already exists, move will rename the file to b.txt.1. If b.txt.1 already exists, move must rename the file to be b.txt.2, and so on, until the file can be successfully renamed with a name that does not already exist.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
