|
13.2.6 Command-line processing
The shell processes a script as follows:
-
split into tokens by the metacharacters: SPACE, TAB, NEWLINE,
;, (, ), <, >, |, &
-
check keyword if not within "..." or '...' (loop)
-
expand alias if not within "..." or '...' (loop)
-
expand brace, a{1,2} -> a1 a2, if
not within "..." or '...'
-
expand tilde, ~user -> user's home
directory, if not within "..." or '...'
-
expand parameter, $PARAMETER, if not within '...'
-
expand command substitution, $(command), if not
within '...'
-
split into words with $IFS if not within "..." or
'...'
-
expand *?[] in pathname if not within "..." or '...'
-
look up command
-
function
-
built-in
-
file in $PATH
-
loop
Single quotes within double quotes have no effect.
Executing set -x in the shell or invoking the shell with
-x option make the shell to print all of commands executed. This
is quite handy for debugging.
|
|