![]() | ![]() | |||||||||||||||
|
Bourne Shell Word ExpansionsSparForte provides a subset of Bourne shell features for convenient use on the command line. Many new users are already familiar with the Bourne shell since it's the standard shell for Linux and FreeBSD. Also, the AdaScript syntax can be awkward to use for simple interactive commands. Where the Bourne standard conflicts with Ada SparForte always favors compatibility with Ada for the sake of the progressive development model. Bourne shell arguments consist of groups of characters called "words". Each word is separated by spaces. SparForte does not implement the Bourne shell IFS variable. Argument expansion is the process of performing substitutions on a Bourne shell word. Argument expansion occurs at run-time since it depends on the current working directory and the current value of variables. Shell Expansion CoverageBourne shell expansions include:
There is no brace expansion, arithmetic expansion or process substitution. Some features support only a subset of the BASH features. For example, many of the special $ substitutions (${...}, $(...) and others) are not implemented. Otherwise, the basic Bourne shell features implemented in SparForte conform to the POSIX standard. Spaces and Dollar ExpansionsVariable expansions are affected by quotation and the data type of expansion variable. If no quotes are used, the leading and trailing spaces are discarded. If in single quotes, no variable expansion occurs at all. If double quotes are used, the affect on spaces depends on the data type. If the value is numeric, the leading space for a positive variable is discarded (to mimic shell behaviour) but other variable types maintain any leading or trailing spaces. To prevent unexpected word splitting, most dollar variable expansions are expected to be quoted. This excludes the special variables $?, $#, and $$ and on the command line. This check can be disabled with pragma suppress( word_quoting ). => s : string := " hello "
Example: The leading/trailing space is affected by quotations and variable type
|
![]() Block Statements and Subprograms |
||||||||||||||||||||||||||||||||
![]() |
![]() |