How do I find the version of bash I am running?



1. If you’re running within a bash shell, then the $BASH_VERSION environment variable should be set:

$ echo $BASH_VERSION4.2.10(1)-release

To extract the first part:

$ echo ${BASH_VERSION%%[^0-9.]*}4.2.10

2. To print out the version information for bash, use bash --version.

GNU bash, version 4.2.10(1)-release (i686-pc-linux-gnu)Copyright (C) 2011 Free Software Foundation, Inc.License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>This is free software; you are free to change and redistribute it.There is NO WARRANTY, to the extent permitted by law.