Lets consider that the output of my every custom execution (some software in linux), gets saved in a generic filename /mydump/xyz.out. Instead of custom naming every output file, I want to write a script which does the following:-
- navigates to /mydump (cd mydump)
- creates a filename using arguments passed eg. config1_config2xconfig3.out
- renames xyz.out to config1_config2xconfig3.out (mv xyz.out "configbasedfilename")
For this what I understand is I should create some function in a script file, eg. custom_rename () and call it with config1-2-3 from the terminal whenever I wish to rename.
eg:- $custom_rename config1 config2 config3
or
$ ./custom_rename.csh config1 config2 config3
or whatever makes sense.
]