From AuroraUX
DeltaSH is a POSIX-compatible shell written in Ada and offering some Ada-like syntax and functionality as a bonus.
Out-Line
- Special Built-in Utilities.
- DeltaSH Syntax Engine.
- Task Management / Job Control.
- Environment Configuration.
- RC Configuration File Parser / RC Configuration File Standard.
- Shell Command Line Interpreter / Shell Interpreter Configuration.
Special Built-in Utilities
The following "special built-in" utilities shall be supported in the shell command language. The output of each command, if any, shall be written to standard output, subject to the normal redirection and piping possible with all commands.
The term "built-in" implies that the shell can execute the utility directly and does not need to search for it. An implementation may choose to make any utility a built-in; however, the special built-in utilities described here differ from regular built-in utilities in two respects:
- A syntax error in a special built-in utility may cause a shell executing that utility to abort, while a syntax error in a regular built-in utility shall not cause a shell executing that utility to abort. (See Consequences of Shell Errors for the consequences of errors on interactive and non-interactive shells.) If a special built-in utility encountering a syntax error does not abort the shell, its exit value shall be non-zero.
- Variable assignments specified with special built-in utilities remain in effect after the built-in completes; this shall not be the case with a regular built-in or other utility.
Some of the special built-ins are described as conforming to the Base Definitions volume of IEEE Std 1003.1-2001, Section 12.2, Utility Syntax Guidelines. For those that are not, the requirement in Utility Description Defaults that "--" be recognized as a first argument to be discarded does not apply and a conforming application shall not use that argument.
The special built-in utilities in this section need not be provided in a manner accessible via the exec family of functions defined in the System Interfaces volume of IEEE Std 1003.1-2001:
- break
- exit from for, while, or until loop (Special Built-in Utility)
- colon
- null utility (Special Built-in Utility)
- continue
- continue for, while or until loop (Special Built-in Utility)
- dot
- execute commands in current environment (Special Built-in Utility)
- eval
- construct command by concatenating arguments (Special Built-in Utility)
- exec
- execute commands and open, close, or copy file descriptors (Special Built-in Utility)
- exit
- cause the shell to exit (Special Built-in Utility)
- export
- set export attribute for variables (Special Built-in Utility)
- readonly
- set read-only attribute for variables (Special Built-in Utility)
- return
- return from a function (Special Built-in Utility)
- set
- set or unset options and positional parameters (Special Built-in Utility)
- shift
- shift positional parameters (Special Built-in Utility)
- times
- write process times (Special Built-in Utility)
- trap
- trap signals (Special Built-in Utility)
- unset
- unset values and attributes of variables and functions (Special Built-in Utility)
Shell Command Language.
The shell is a command language interpreter. This chapter describes the syntax of that command language as it is used by the sh utility and the system() and popen() functions defined in the System Interfaces volume of IEEE Std 1003.1-2001.
The shell operates according to the following general overview of operations. The specific details are included in the cited sections of this chapter.
- The shell reads its input from a file (see sh), from the -c option or from the system() and popen() functions defined in the System Interfaces volume of IEEE Std 1003.1-2001. If the first line of a file of shell commands starts with the characters "#!", the results are unspecified.
- The shell breaks the input into tokens: words and operators; see Token Recognition.
- The shell parses the input into simple commands (see Simple Commands) and compound commands (see Compound Commands).
- The shell performs various expansions (separately) on different parts of each command, resulting in a list of pathnames and fields to be treated as a command and arguments; see Word Expansions.
- The shell performs redirection (see Redirection) and removes redirection operators and their operands from the parameter list.
- The shell executes a function (see Function Definition Command), built-in (see Special Built-In Utilities), executable file, or script, giving the names of the arguments as positional parameters numbered 1 to n, and the name of the command (or in the case of a function within a script, the name of the script) as the positional parameter numbered 0 (see Command Search and Execution).
- The shell optionally waits for the command to complete and collects the exit status (see Exit Status for Commands).