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 |
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.
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. |
# 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). |
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.
The default editor invoked by a script, usually vi or emacs.
"effective" user ID number
Identification number of whatever identity the current user has assumed, perhaps by means of su.
The $EUID is not necessarily the same as the $UID. |
Name of the current function
xyz23 () { echo "$FUNCNAME now executing." # xyz23 now executing. } xyz23 echo "FUNCNAME = $FUNCNAME" # FUNCNAME = # Null value outside a function. |
See also Example A-50.
A list of filename patterns to be excluded from matching in globbing.
About AquaClusters Privacy Policy Support Version - 19.0.2-4 AquaFold, Inc Copyright © 2007-2017