| mkscript | system | mkscript |
mkscript -- make a script for a command sequence to be run in batch
mkscript script task submit
A command script is created consisting of a number of commands to be executed sequentially. The task assumes the responsibility of formatting the command and placing it in the script file. The user sets the parameter values using the parameter editor eparam . As an optional final stage the task will optionally submit the script as a background job.
The sequence of steps are outline as follows:
The parameter hidden is important for the following reason. If the hidden parameters are not explicitly included in the script commands then the values of the hidden parameters will be those in the parameter file at the time of execution. Thus, in changes in the hidden parameters with eparam or explicit changes may produce unexpected results. However, if the hidden parameters are never changed then the commands are more readable when the hidden parameters are not included.
One of the most common usages in data reductions is to create repeated commands with different input data or parameters.
cl> mkscript script.cl transform
[\fIeparam\fR is called to set the parameter values for \fItransform\fR]
transform ("n1r.008", "n1r.008a", "disp012,distort,disp013",
database="identify.db", interptype="spline3", x1=1., x2=256., dx=1.,
nx=256., xlog=no, y1=4300., y2=6300., dy=INDEF, ny=800., ylog=no,
flux=yes, logfiles="STDOUT,logfile")
Is the command ok? (yes):
Add another command? (yes):
[\fIeparam\fR is called again for task \fItransform\fR]
transform ("n1r.010", "n1r.010a", "disp013,distort",
database="identify.db", interptype="spline3", x1=1., x2=256., dx=1.,
nx=256., xlog=no, y1=4300., y2=6300., dy=INDEF, ny=800., ylog=no,
flux=yes, logfiles="STDOUT,logfile")
Is the command ok? (yes):
Add another command? (yes): no
[The script is paged]
Is the script ok? (yes):
Submit the script as a background job? (yes):
Script script.cl submitted at:
Fri 10:32:57 01-Nov-85
[1]
To combine several tasks:
cl> mkscript script.cl ver- sub- hid- Task name of command to be added to script: response [\fIeparam\fR is called for \fIresponse\fR and parameter values are set] Add another command? (yes): Task name of command to be added to script: imarith ... Add another command? (yes): no
To run the command script as a foreground job:
cl> cl < script.cl
To run the command script as a background job:
cl> cl < script.cl >& logfile &
Note that the output including possible error output is redirected to a logfile.
The current implementation is preliminary. It is done with a script which makes it seem somewhat slow. The most important bug is that the command formatter is based on the output of lparam . If a task parameter name exceeds 12 characters it is truncated by lparam and is then also truncated by the command formatter. The script will then fail when executed! Also the task name may not be abbreviated.