sh — Start a new ABLE shell
sh
[-x] [-e] [-v] [-i] [--help] [--version]
-x
Display the command to be executed with its variables expanded.
-e
Exit immediately if a command fails
-v
Display lines of input as they are read.
-i
Start an interactive shell
--help
Display short helptext and exit
--version
Display 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 $_
.