bash lookup defined variables

found this in the linux journal, looks real usefull

#what was the variable storing the version of my bash ?
cb0: echo ${!B*}
BASH BASH_ARGC BASH_ARGV BASH_COMMAND BASH_LINENO BASH_SOURCE BASH_SUBSHELL BASH_VERSINFO BASH_VERSION
#I get a list of all bash variables that start with 'B'

Leave a Reply