While it is possible to run a script from the unix command line using a redirection operator (
) or pipe (
), there are occasions when this is problematic such as when running ProFit from within another application. It possible to use a command line flag to run a script file.
For example, a script file can be run using either the redirection operator:
profit -h reference.pdb mobile.pdb < myscriptfile.txtOr a command line flag:
profit -f myscriptfile.txt -h reference.pdb mobile.pdbBoth commands produce identical outputs.
It is also possible to run a script from within ProFit using the SCRIPT command:
SCRIPT myscriptfile.txt
When a script file is run, messages indicating the start and end of the script are sent to stdout, if quiet mode is off. A comment marker (#) at the beginning of a line will echo the line to stdout, a useful method for annotating an output file when running non-interactively.
Finally, it is possible to run a script from within a script using the SCRIPT command. ProFit tracks the number of open/nested scripts and will allow up to 1000 nested scripts to be open. The assumption is that if over a thousand scripts are open then ProFit has been sent into an infinite loop (for instance by having a script call itself).