Content deleted Content added
m →Unix shells: use columns |
Blush30720 (talk | contribs) →Syntax: prose, add double quotes |
||
Line 503:
-->
: <syntaxhighlight lang = text>
"Tokens"
\_ "Blanks"
\_ "Operators" (Ops)
\_ "Control Ops"
\_ "Redirection Ops"
\_ "Words"
\_ "Reserved Words"
\_ "Names"
</syntaxhighlight>
When Bash reads a full commandline, the complete string is broken down according to a certain set of rules into individual units called ''"tokens."''
* The ten ''"metacharacters:"''
Line 520:
: {{Pre |‘space’ ‘tab’ ‘newline’ ‘|’ ‘&’ ‘;’ ‘(’ ‘)’ ‘<’ ‘>’}}
''"Blanks"'' are composed entirely of unquoted metacharacters, ''"operators"'' each contain at least one unquoted metacharacter and ''"words"'' may not include any unquoted metacharacters.
In practice, Bash breaks down full command strings into tokens or groups of tokens that ''do'' contain "metacharacters"
From there it further breaks ''words'' down into more specific, meaningful pieces like command names, variable assignment statements, etc.
Line 543:
</syntaxhighlight>
A ''"word"'' is a sequence of (non-meta-) characters treated as a single unit by the shell.
A ''"reserved word"'' is a kind of a ''"word"'' that has a special meaning to the shell.<ref>
{{Cite web
| access-date = 18 August 2025
Line 551:
}}
</ref>
A ''"name"'' is a kind of a ''"word,"'' separate from ''reserved words'', which consists solely of letters, underscores and numbers; which begins with either a letter or an underscore; which, however, may not begin with a number.
''"Names,"'' also called ''"identifiers,"'' may be used for naming variables and functions.
* ''"Words"''
Line 568:
</syntaxhighlight>
In
: <syntaxhighlight lang = console>
|