Redhat: Nói thêm về Shell Parameters



Redhat: Nói thêm về Shell Parameters

Redhat:  Nói thêm về  Shell Parameters

Link playlist
Red Hat Enterprise Linux Administration
https://www.youtube.com/playlist?list=PLIpLw6v7Z1qnIUiJipjgYEHwxF16TZbCN
2023 07 06 04 19 47

Understanding Shell Parameters
A shell parameter (or simply a parameter) is an entity that holds a value such
as a name, special character, or number. The parameter that holds a name is
referred to as a variable; a special character is referred to as a special
parameter; and one or more digits, except for 0 is referred to as a positional
parameter (a.k.a. a command line argument). A special parameter represents
the command or script itself ($0), count of supplied arguments ($* or $@), all
arguments ($#), and PID of the process ($$). A positional parameter ($1, $2,
$3 . . .) is an argument supplied to a script at the time of its invocation, and its
position is determined by the shell based on its location with respect to the
calling script. Figure 22-1 gives a pictorial view of the special and positional
parameters.
Figure 22-1 Shell Parameters
Figure 22-1 also shows that positional parameters beyond 9 are to be
enclosed in curly brackets. Just like the variable and command substitutions,
the shell uses the dollar ($) sign for special and positional parameter
expansions as well.