- Some users use a personal wrapper script to generate a arrays of submission scripts.
- On this case, the user may loose some aliases definitions because, by default, only an interactive bash inherits the aliases definitions. That problem can be bypassed if the user adds the following settings to his personal wrapper.
# ! /bin/bash -l shopt -s expand_aliases
Here is an example of a very simple job wrapper that should be executed as my_job_wrapper.sh 1 10
- Generates and submits 10 different scripts with 10 different input files and output files.
$ cat my_job_wrapper.sh # ! /bin/bash shopt -s expand_aliases i=$1 while [ $i -le $2 ]; do cat << EOF > job.sh.$i #\$ -v SGEIN1=input_file$i.txt #\$ -v SGEOUT1=output_file$i.txt cat input_file$i.txt >> output_file$i.txt EOF qsub job.sh.$i rm -f job.sh.$i i=`expr $i + 1` done exit 0