Chapter 4.4: Shell Access |
[TOP] [UP] [PREV] [NEXT] |
CML provides one comprehensive function ($xshell()) for accessing the Unix (or NT) command interpreter or "shell" (and thereby running commands or scripts from the shell).
For historical reasons (and to provide backward compatibility with earlier versions CML), several other shell functions are provided that implement subcases of $xshell().
Synch controls synchronous operation. If 1, the command executes synchronously, i.e. $xshell() does not "return" until the command is complete. If 0, the command executes asynchronously, and $xshell() returns immediately (with no output, regardless of the value of output).
Finally, on Unix systems, effective controls the permissions with which command is run. If 1, the command runs with its real id as the Caucus id (see the parameter Caucus_ID in the swebd.conf configuration file). If 0, the command runs as the "real" id, as specified by the parameter Real_ID in swebd.conf.
Warnings and Notes:
Note also that all of the shell functions are ignored (have no effect) when inside a $protect() function.
"It is now: $shell(date)
Equivalent to $xshell (1 1 0 command).
Equivalent to $xshell (type 1 0 command).
" $silent(echo $userid() >>/tmp/log)
Equivalent to $xshell (0 1 0 command).