0

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:-

  1. navigates to /mydump (cd mydump)
  2. creates a filename using arguments passed eg. config1_config2xconfig3.out
  3. 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.

1 Answers1

1

You could write your own, probably limited script. Why not use "Bulk-rename" or similar packages, that are readily available?

[1]

There are more tools available. I wouldn't write anything myself...

kanehekili
  • 7,426