next up previous contents
Next: Variables and parameter substitution Up: Basics of data management Previous: Naming of data items

Commands, switches, scripts and script parameters

Commands can be run directly using the command line of ndashell or script files. Script files are normal text files containing one command per line. `#' can be used to add comments to scripts. In each line, all characters after a `#' are omitted while executing commands. A script file can be run directly by writing its name on the command line. You can specify parameters to scripts on the command line and refer to these specified values with $1 ... $9, ${10} ... ${nn} in scripts.

Parameter substitution can be temporarily postponed by adding a ` tex2html_wrap_inline7109 ' character on the command line. Everything after the backslash will not be substituted, unless an enclosing ` tex2html_wrap_inline7109 ' is encountered. That is, all characters between two backslashes will be taken literally in the first evaluation of the command line. Some commands, such as if and while, re-evaluate the specified command line before executing it. This can be useful while executing a command for all script parameters (see section 9.2).

Normally commands are echoed before execution, but this can be disabled either using echo -off (see section 9.3) or by starting each command line with a `@'. `@' needs to be the first character on that line and even no whitespace characters may precede it! echo -off is only useful in scripts, because echoing of command is restored, when the execution of a script ends. Error messages are displayed regardless of the echo setting.

All command parameters have to be written onto the same line and switches cannot be combined after a single `-'. For example, ls -tup (see section 2.2) will try to show item -tup, and rm -rfr boston (see section 2.3) results in an Invalid parameter(s) for command error. Instead, you should use ls -t -u -p, for example. Most of the other command also produce an error message, if they are given unexpected switches or illegal data types.

ndashell for UNIX tex2html_wrap_inline7115 itself recognizes three special switches:

 
		-d <directory>

-f <cmdfile> [<parameters>]

-quit

-batch

If a directory is specified with -d the current working directory in the UNIX filesystem is first changed into this directory. If a command (or script) file is specified with -f, it is run immediately after ndashell has initialized itself. Parameters can also be specified, if applicable. If -quit is specified, ndashell exits right after the execution of the script has finished. If -batch is specified, the XView graphical user interface will not be started at all.

To change the current UNIX filesystem directory while the NDA is running cwd (see section 9.1) can be used. If an error is encountered while running a script, the execution of all running scripts is terminated immediately, unless stop -off (see section 9.6) has been executed earlier.


next up previous contents
Next: Variables and parameter substitution Up: Basics of data management Previous: Naming of data items

Anssi Lensu
Thu May 17 15:00:44 EET DST 2001