XSH Language

Files/Documents
Tree navigation
Tree modification
Flow control
Retrieving more information
Argument Types
Variables
Options
Interacting with Perl and Shell

XSH acts as a command interpreter. Individual commands must be separated with a semicolon. Each command may be followed by a pipeline redirection to capture the command's output. In the interactive shell, backslash may be used at the end of line to indicate that the command follows on the next line.

A pipeline redirections may be used either to feed the command's output to a unix command or to store it in a XSH string variable.

In the first case, the syntax is xsh-command | shell-command ; where xsh-command is any XSH command and shell-command is any command (or code) recognized by the default shell interpreter of the operating system (i.e. on UNIX systems by sh or csh, on Windows systems by cmd). Brackets may be used to join more shell commands (may depend on which shell is used).

Example 1. Count attributes of words containing string foo in its name or value.

xsh> ls //words/@* | grep foo | wc

In order to store a command's output in a string variable, the pipeline redirection must take the form xsh-command |> $variable where xsh-command is any XSH command and $variable is any valid name for a string variable.

Example 2. Store the number of all words in a variable named count.

xsh> count //words |> $count

help command gives a list of all XSH commands.

help type gives a list of all argument types.

help followed by a command or type name gives more information on the particular command or argument type.