In the previous examples, you have run the executables with a shell script, in which input and output files are specified inside the .sh file. If you want to run on a whole lot of files, it can get tedious to type every file name into the shell script. There are various solutions to this. Here is one solution: this is an example Perl script that allows you to run the example1 executable on a list of files specified with a wildcard. It can be modified to suit various situations.
Copy the following file from
/var/phy/project/hep/neutrino/work/schol/superk/examplesinto your working directory:
$exename = "./example1";In this case, the executable name is example1.
$scriptname = "./rfscript.sh";In this case, the rflist shell script name is rfscript.sh.
./rfscript_example.pl 1 /var/phy/project/hep/neutrino/work/schol/superk/data/rfm*It will create a shell script, rfscript.sh, with all the files satisfying the wildcard given as input files. Examine the shell script to check this.
You can then run ./rfscript.sh by hand. Or, you can create the shell script and run it, all in one step, by turning off test mode with:
./rfscript_example.pl 0 /var/phy/project/hep/neutrino/work/schol/superk/data/rfm*
In addition to using your specific executable and shell script names, you can modify this Perl script to have it set environment variables in the shell script, allow more sophisticated selection of files, etc. You can specify additional arguments if necessary, too.