-
Notifications
You must be signed in to change notification settings - Fork 6
Special Parameters #54
Copy link
Copy link
Open
Labels
L1: enhancementNew feature or requestNew feature or requestM: programModule: Oursh language(s) with lexers, parsers and evaluation runtimes.Module: Oursh language(s) with lexers, parsers and evaluation runtimes.T: semanticsTopic: Program evaluation issues or featuresTopic: Program evaluation issues or features
Milestone
Description
Metadata
Metadata
Assignees
Labels
L1: enhancementNew feature or requestNew feature or requestM: programModule: Oursh language(s) with lexers, parsers and evaluation runtimes.Module: Oursh language(s) with lexers, parsers and evaluation runtimes.T: semanticsTopic: Program evaluation issues or featuresTopic: Program evaluation issues or features
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.