On many occasions one has to subtract a constant from a series of files, or perhaps divide a set of files by another file. repet is intended to facilitate such operations, although if you are a C-shell whizz you can do the same thing with 'foreach'.
For instance, suppose you want to subtract the same file 'sfile' from a series of files contained in a list 'flist', then the command:
repet "$STARLINK_DIR/bin/figaro/isub %%% sfile %%%" @flist
will do it. Note that although this is an NDF/Figaro command, there is nothing especially NDF-based about repet, and, for instance it does not attempt to remove .sdf extensions or check for the existence of files. Thus:
repet "mv %%%.sdf\;1 %%%.sdf" @flist
can be used to change the names of the form r345.sdf;1 to r345.sdf thus removing the irritating ; which needs to be escaped all the time. If something goes wrong, check the junkzzz script that is produced.
Why "repet" and not "repeat"? because there is a built-in shell command of that name.
command | --- | the command to be carried out. |
file1, file2 | --- | are individual files. |
list1, list2 | --- | are ascii lists of files (flagged by @). |
Author: T.R. Marsh
Created: 14 January 2001
Revised: 08 December 2005