When a run is submitted as a script, the script and its options are simply provided on the command line. Additional enfsub options can be specified in the script to avoid the need to place them on the command line every time the script is executed.
Scripts are submitted similarly to command line programs:
enfsub [ <enfsub_options> ] <script> [ <script_options> ]The script and its options are provided as parameters to the enfsub program. They can be preceded by <enfsub_options>, which are enfsub specific parameters. Details about enfsub and its options are provided in the Section called The enfsub Program in Chapter 10. The <script> file must be already available on the node or copied explicitly as part of the enfsub command.
An example:
enfsub -i myscript.sh myscript.shThis example copies the script myscript.sh to the node and executes it.
<enfsub_options> can also be specified in the script. Enfsub identifies scripts. On Linux/Unix, scripts start with a string "#!". On Windows, scripts are files that have the suffix ".bat". If Enfsub detects a script as opposed to a binary executable, it checks the script for any Enfsub options. On Linux/Unix, Enfsub options are lines that start with "#ENF". On Windows, options are lines that start with "@rem ENF" or "rem ENF". If an option is specified on the command line and in the script, then the command line value takes precedence.
The following is a Windows script that has the same effect as the command line example in the previous section:
@echo off
rem ENF -i script.bat
rem
rem ENF -n sample -a account -v VAR1=value1
rem ENF -i input.file=input.txt
rem ENF -o output-$ENFJOBNAME-$ENFHOSTNAME.txt=output.file,input
rem ENF -r -count 2 -e user@domain.com -m d
copy input.file input > output.file
set >> output.file
The script is submitted with:
enfsub.exe script.bat
The following is a Linux/Unix script that has the same effect as the command line example above:
#!/bin/sh #ENF -i script.sh #ENF -n sample -a account -v VAR1=value1 #ENF -i input.file=input.txt #ENF -o output-$ENFJOBNAME-$ENFHOSTNAME.txt=output.file,input #ENF -rd -count 2 -e user@domain.com -m d cp input.file input > output.file set >> output.fileThe script is submitted with:
enfsub ./script.sh