Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Special Parameters #54

Open
Tracked by #27 ...
nixpulvis opened this issue Aug 11, 2021 · 0 comments
Open
Tracked by #27 ...

Special Parameters #54

nixpulvis opened this issue Aug 11, 2021 · 0 comments
Labels
L1: enhancement New feature or request M: program Module: Oursh language(s) with lexers, parsers and evaluation runtimes. T: semantics Topic: Program evaluation issues or features
Milestone

Comments

@nixpulvis
Copy link
Owner

nixpulvis commented Aug 11, 2021

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.
@nixpulvis nixpulvis added L1: enhancement New feature or request T: semantics Topic: Program evaluation issues or features labels Aug 11, 2021
@nixpulvis nixpulvis added this to the POSIX milestone Aug 11, 2021
@nixpulvis nixpulvis changed the title Special Variables (Parameters) Special Parameters Aug 11, 2021
@nixpulvis nixpulvis added the M: program Module: Oursh language(s) with lexers, parsers and evaluation runtimes. label Aug 13, 2021
@nixpulvis nixpulvis mentioned this issue Aug 13, 2021
12 tasks
This was referenced Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L1: enhancement New feature or request M: program Module: Oursh language(s) with lexers, parsers and evaluation runtimes. T: semantics Topic: Program evaluation issues or features
Projects
None yet
Development

No branches or pull requests

1 participant