Skip to content

Instantly share code, notes, and snippets.

@kyrose
Created April 28, 2021 21:38
Show Gist options
  • Save kyrose/d88f94ed82178fe2832498ef3b00901e to your computer and use it in GitHub Desktop.
Save kyrose/d88f94ed82178fe2832498ef3b00901e to your computer and use it in GitHub Desktop.
Special parameters in Bash

Special parameters

parameter definition
$0 Returns name of shell/shell-script currently being executed
$n Positional parameters
$* All positional parameters as a single string
$@ List of all positional parameters
$# Number of positional parameters
$? Exit status of last executed command
$$ Process ID of the shell
$! Process ID of last background process
$_ Last argument to the previous command
$- Returns entire set of options specified at shell launch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment