Revision [1021]

This is an old revision of CommandSet made by DavidLee on 2009-11-25 13:58:07.

 

Command set


Name

set sets options and positional parameters

Synopsis

set [options] [param1 [param2 ...]]


Options


-x Turns on execution tracing (default off)
-v Turns on command interpretation parse tracing (default off)
-e Turns on "throw on error" mode (default off)
-xpipe Turns on the xpipe implementation for pipes (Experimental) (default off)

The set command also supports all of the global Serialization Options


set options


If any options are specified then they set the global shell options for the current shell.
Preceding any boolean option by a + instead of a - will turn OFF that option.

Example
set +omit-xml-declaration

turns OFF the omit-xml-declaration option

Execute Trace (-x)

If -x is set then commands are printed to the error output prior to execution

Verbose (-v)

if -v is set then commands are printed to the error output while parsed

Throw On Error (-e)

If -e is set, then an exception is throw equivalent to using the throw command whenever a simple command returns a non-zero value, except when the command is the condition for an if, while or until, or when preceded by a "!".

If the shell is not interactive, and the exception is not trapped with a try, it will cause the shell to exit.



set parameters

Sets the positional parameters or prints environment variables

Example: sets $1 to "foo" and $2 to "bar"
$ set foo bar


Positional parameters can also be XML expressions
$ set <[1,"foo",<bar>spam</bar>]>


print variables

With no arguments prints the names and types of all variables as an xml document.
Note this differences from the unix shells in that it doesnt print the variables value, this is because
values in xmlsh can be extremely large.
$ set
<env>
   <variable name="a" type="xml"/>
   <variable name="PATH" type="string"/>
</env>


Commands
There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki