Bash (Unix shell): Difference between revisions

Content deleted Content added
Syntax: edit blockquote
Line 500:
 
<!-- Important concepts:
[] stream of characters
[] delineate full commandlines (newline, semi-colon)
[] division into commands and parts of commands (optargs)
[] uses metacharacters
-->
<syntaxhighlight lang = text>
Line 526 ⟶ 529:
 
 
When Bash reads a ''full commandline,'' the complete string is broken down according to a certain set of rules into individual units called ''"tokens."''
"Tokens" are identified using, and separated from each other using ''"metacharacters."'' (As of version 5.3:)
 
Line 535 ⟶ 538:
''"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" and tokens or groups of tokens that do ''not'' contain any "metacharacters" -- called ''"words."''
From there it further breaks ''words'' down into more specific, meaningful pieces like command names, variable assignment statements, etc.