sh — Start a new ABLE shell
sh [-x] [-e] [-v] [-i] [--help] [--version]
-xDisplay the command to be executed with its variables expanded.
-eExit immediately if a command fails
-vDisplay lines of input as they are read.
-iStart an interactive shell
--helpDisplay short helptext and exit
--versionDisplay commands version and exit
This command starts a new ABLE shell, for full information on using the shell refer to Chapter 3, Command Line Interface. The newly created shell environment is separate from the invoking shell, variables from the parent are not available and upon exit any variables set within the shell are lost.
Example 10.3. Subshell variable scope
This example shows setting variables in the outer shell and in the subshell and their scope.
>echo ${FOO}
>echo ${BAR}
>FOO="hello and goodbye"
>BAR="goodbye and hello"
>sh
>echo ${FOO}
>echo ${BAR}
>BAR="something else"
>FOO="entirely"
>echo ${FOO} ${BAR}
something else entirely
>exit
>echo ${FOO}
hello and goodbye
>echo ${BAR}
goodbye and hello
>The -x, -e and
-v switches control the shells overall
behaviour, these variables are accessed from the shell using
the special
variable $_.