I have files: x0001_test.xml z0054_test.xml k5487_test.xml….
I would like to save them doing something like: cp *_test.xml ${BEGINNING}_test.xml.SAVE.
Is there a way in bash script to store the content of * for each file in order to re-inject it after? Or should I use a loop?
A loop to do that is probably trivial enough to not need a separate one-line command. You don’t need to save a portion of the filename since you’re just adding
.SAVEto the whole thing:And, in any case, you can do it in one line if you really want: