I have a program in a “Working directory” but I also have multiple versions of this program in other folders. I want to easily change the version that resides in the working directory while backing up the current residing working one.
Currently, I have to do this manually with the following keystrokes.
cd /working/directory cat version_number_file (to find out what version Im working with) cd /working mv -i foo/ /program_version_xxx (version identified from above) mv -i bar/ /program_version_xxx (version identified from above) cd /mnt/foo/bar/some/folder mv -i file.info /program_version_xxx (version identified from above)
now the program is backed up, we can move the wanted version into the working directory.
cd /program_version_xxx (desired version) mv -i foo/ /working mv -i bar/ /working mv -i file.info /mnt/foo/bar/some/folder/
I want to create a script that moves the files in the working directory into its respective “version folder” for later use and copies the version I want to use back into the working directory.
The said program has a file with it’s version number in it and that correlates to the same folder name where it resides when not in use. So the script should be able to cat this file in the working directory and see the version number, and know what folder those files belong in.
I don’t mind having multiple scrips, as in one for each version I want to change to. Better if the script had a menu system that would ask what version I wanted to switch to (but that’s probably asking to much)