oursh
oursh copied to clipboard
Special Parameters
Section 2.5.2 Special Parameters of the POSIX standard defines a list of special characters we should interpret:
-
?
- Expands to the decimal exit status of the most recent pipeline. -
-
- Expands to the current option flags. -
$
- Expands to the decimal process ID of the invoked shell. In a subshell (see Shell Execution Environment ), '$' shall expand to the same value as that of the current shell. -
!
- Expands to the decimal process ID of the most recent background command (see Lists) executed from the current shell. -
0
- Expands to the name of the shell or shell script. -
#
- Expands to the decimal number of positional parameters. -
-
@
- Expands to the positional parameters, starting from one, initially producing one field for each positional parameter that is set.
-
-
*
- Expands to the positional parameters, starting from one, initially producing one field for each positional parameter that is set. Read more in 2.5.2.