Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
syntax:shellvars [2018/07/17 09:04]
thebonsai [PATH]
syntax:shellvars [2019/11/02 14:56] (current)
ersen fix some typos and EPOCHSECONDS type
Line 4: Line 4:
  
 ^parameter^character^expansion description^ ^parameter^character^expansion description^
-|''​*''​|asterisk|The positional parameters starting from the first. When used inside doublequotes (see [[syntax:​quoting | quoting]]), like ''"​$*"'',​ it expands to all positional parameters //as one word//, delimited by the first character ​if the ''​IFS''​ variable (a space in this example): ''"​$1 $2 $3 $4"''​. \\ If ''​IFS''​ is unset, the delimiter used will be always a space, if ''​IFS''​ is NULL, the delimiter will be nothing, which effectively concatenates all the positional parameters without any delimiter. \\ When used unquoted, it will just expand to the strings, one by one, not preserving the word boundaries (i.e. word splitting will split the text again, if it contains ''​IFS''​ characters. \\ See also the [[scripting:​posparams | scripting article about handling positional parameters]].|+|''​*''​|asterisk|The positional parameters starting from the first. When used inside doublequotes (see [[syntax:​quoting | quoting]]), like ''"​$*"'',​ it expands to all positional parameters //as one word//, delimited by the first character ​of the ''​IFS''​ variable (a space in this example): ''"​$1 $2 $3 $4"''​. \\ If ''​IFS''​ is unset, the delimiter used will be always a space, if ''​IFS''​ is NULL, the delimiter will be nothing, which effectively concatenates all the positional parameters without any delimiter. \\ When used unquoted, it will just expand to the strings, one by one, not preserving the word boundaries (i.e. word splitting will split the text again, if it contains ''​IFS''​ characters. \\ See also the [[scripting:​posparams | scripting article about handling positional parameters]].|
 |''​@''​|at-sign|The positional parameters starting from the first. When used inside doublequotes (see [[syntax:​quoting | quoting]]), like ''"​$@"'',​ it expands all positional parameters //as separate words//: ''"​$1"​ "​$2"​ "​$3"​ "​$4"''​ \\ Without doublequotes,​ the behaviour is like the one of ''​*''​ without doublequotes. \\ See also the [[scripting:​posparams | scripting article about handling positional parameters]].| |''​@''​|at-sign|The positional parameters starting from the first. When used inside doublequotes (see [[syntax:​quoting | quoting]]), like ''"​$@"'',​ it expands all positional parameters //as separate words//: ''"​$1"​ "​$2"​ "​$3"​ "​$4"''​ \\ Without doublequotes,​ the behaviour is like the one of ''​*''​ without doublequotes. \\ See also the [[scripting:​posparams | scripting article about handling positional parameters]].|
 |''#''​|hash mark|Number of positional parameters (decimal) \\ See also the [[scripting:​posparams | scripting article about handling positional parameters]].| |''#''​|hash mark|Number of positional parameters (decimal) \\ See also the [[scripting:​posparams | scripting article about handling positional parameters]].|
Line 129: Line 129:
 ^Set by Bash:  |no  ^Default: |n/a  | ^Set by Bash:  |no  ^Default: |n/a  |
  
-The value is used to set the shell'​s compatibility level. The value may be a decimal number (e.g., ''​4.2''​) or an integer (e.g., ''​42''​) corresponding to the desired ​com patibility ​level. If ''​BASH_COMPAT''​ is unset or set to the empty string, the compatibility level is set to the default for the current version. If  ''​BASH_COMPAT''​ is set to a value that is not one of the valid compatibility levels, the shell prints an error message and sets the compatibility level to the default for the current version. The valid compatibility levels correspond to the compatibility options accepted by the shopt builtin. The current version is also a valid value.+The value is used to set the shell'​s compatibility level. The value may be a decimal number (e.g., ''​4.2''​) or an integer (e.g., ''​42''​) corresponding to the desired ​compatibility ​level. If ''​BASH_COMPAT''​ is unset or set to the empty string, the compatibility level is set to the default for the current version. If  ''​BASH_COMPAT''​ is set to a value that is not one of the valid compatibility levels, the shell prints an error message and sets the compatibility level to the default for the current version. The valid compatibility levels correspond to the compatibility options accepted by the shopt builtin. The current version is also a valid value.
  
 ==== BASH_EXECUTION_STRING ==== ==== BASH_EXECUTION_STRING ====
Line 313: Line 313:
 ==== EPOCHSECONDS ==== ==== EPOCHSECONDS ====
 ^Variable: ​ |''​EPOCHSECONDS'' ​ ^Since: ​ |5.0-alpha ​  | ^Variable: ​ |''​EPOCHSECONDS'' ​ ^Since: ​ |5.0-alpha ​  |
-^Type: ​ |integer ​indexed array   ^Read-only: ​ |no  |+^Type: ​ |integer ​variable ​  ^Read-only: ​ |no  |
 ^Set by Bash:  |yes  ^Default: |n/a  | ^Set by Bash:  |yes  ^Default: |n/a  |
  
Line 752: Line 752:
 ^Variable: ​ |''​HISTSIZE'' ​ ^Since: ​ |unknown ​  | ^Variable: ​ |''​HISTSIZE'' ​ ^Since: ​ |unknown ​  |
 ^Type: ​ |normal variable ​ ^Read-only: ​ |no  | ^Type: ​ |normal variable ​ ^Read-only: ​ |no  |
-^Set by Bash:  |if unset  ^Default: |500  |+^Set by Bash:  |if unset  ^Default: |set at compile time (default ​500 |
  
 The number of commands to remember in the command history. The number of commands to remember in the command history.
Line 988: Line 988:
  
 Characters removed are replaced with an ellipsis. Characters removed are replaced with an ellipsis.
 +
 +==== PS0 ====
 +^Variable: ​ |''​PS0'' ​ ^Since: ​ |4.4.0 ​  |
 +^Type: ​ |normal variable ​ ^Read-only: ​ |no  |
 +^Set by Bash:  |if unset  ^Default: |"''''" ​ |
 +
 +Expanded and displayed by interactive shells after reading a complete command but before executing it.
  
 ==== PS1 ==== ==== PS1 ====
  • syntax/shellvars.1531818255.txt
  • Last modified: 2018/07/17 09:04
  • by thebonsai