Easily find issues by searching: #<Issue ID>
Example: #1832
Easily find members by searching in: <username>, <first name> and <last name>.
Example: Search smith, will return results smith and adamsmith
Advanced Bash-Scripting Guide: | ||
---|---|---|
Prev | Chapter 9. Another Look at Variables | Next |
Process ID of the current instance of Bash. This is not the same as the $$ variable, but it often gives the same result.
bash4$ echo $$ 11015 bash4$ echo $BASHPID 11015 bash4$ ps ax | grep bash4 11015 pts/2 R 0:00 bash4 |
#!/bin/bash4 echo "\$\$ outside of subshell = $$" # 9602 echo "\$BASH_SUBSHELL outside of subshell = $BASH_SUBSHELL" # 0 echo "\$BASHPID outside of subshell = $BASHPID" # 9602 echo ( echo "\$\$ inside of subshell = $$" # 9602 echo "\$BASH_SUBSHELL inside of subshell = $BASH_SUBSHELL" # 1 echo "\$BASHPID inside of subshell = $BASHPID" ) # 9603 # Note that $$ returns PID of parent process. |
An environmental variable pointing to a Bash startup file to be read when a script is invoked
A variable indicating the subshell level. This is a new addition to Bash, version 3.
See Example 21-1 for usage.
A 6-element array containing version information about the installed release of Bash. This is similar to $BASH_VERSION, below, but a bit more detailed.
# Bash version info: for n in 0 1 2 3 4 5 do echo "BASH_VERSINFO[$n] = ${BASH_VERSINFO[$n]}" done # BASH_VERSINFO[0] = 3 # Major version no. # BASH_VERSINFO[1] = 00 # Minor version no. # BASH_VERSINFO[2] = 14 # Patch level. # BASH_VERSINFO[3] = 1 # Build version. # BASH_VERSINFO[4] = release # Release status. # BASH_VERSINFO[5] = i386-redhat-linux-gnu # Architecture # (same as $MACHTYPE). |
$BASH_VERSION
The version of Bash installed on the system
bash$ echo $BASH_VERSION 3.2.25(1)-release |
tcsh% echo $BASH_VERSION BASH_VERSION: Undefined variable. |
Checking $BASH_VERSION is a good method of determining which shell is running. $SHELL does not necessarily give the correct answer.
A colon-separated list of search paths available to the cd command, similar in function to the $PATH variable for binaries. The $CDPATH variable may be set in the local ~/.bashrc file.
bash$ cd bash-doc bash: cd: bash-doc: No such file or directory bash$ CDPATH=/usr/share/doc bash$ cd bash-doc /usr/share/doc/bash-doc bash$ echo $PWD /usr/share/doc/bash-doc |
The top value in the directory stack [1] (affected by pushd and popd)
This builtin variable corresponds to the dirs command, however dirs shows the entire contents of the directory stack.
$EDITOR
The default editor invoked by a script, usually vi or emacs.
About AquaClusters Privacy Policy Support Version - 19.0.2-4 AquaFold, Inc Copyright © 2007-2017