Table of Contents

Bash - Version

About

Version of Bash

Variable

The version information can be found in the following shell variable

BASH_VERSION

Expands to a string describing the version of this instance of bash.

echo ${BASH_VERSION}
4.3.46(1)-release

BASH_VERSINFO

A readonly array variable whose members hold version information for this instance of bash. The values assigned to the array members are as follows:

Example

echo ${BASH_VERSINFO[0]}
4

echo ${BASH_VERSINFO[1]}
3

echo ${BASH_VERSINFO[2]}
46

echo ${BASH_VERSINFO[3]}
1

echo ${BASH_VERSINFO[4]}
release

echo ${BASH_VERSINFO[5]}
x86_64-pc-linux-gnu

Documentation / Reference