Bash - Version

Bash Liste Des Attaques Ovh

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:

  • BASH_VERSINFO[0] The major version number (the release).
  • BASH_VERSINFO[1] The minor version number (the version).
  • BASH_VERSINFO[2] The patch level.
  • BASH_VERSINFO[3] The build version.
  • BASH_VERSINFO[4] The release status (e.g., beta1).
  • BASH_VERSINFO[5] The value of MACHTYPE.

Example

  • The major version number (the release).
echo ${BASH_VERSINFO[0]}
4

  • The minor version number (the version).
echo ${BASH_VERSINFO[1]}
3

  • The patch level
echo ${BASH_VERSINFO[2]}
46

  • The build version
echo ${BASH_VERSINFO[3]}
1

  • The release status (e.g., beta1)
echo ${BASH_VERSINFO[4]}
release

  • The value of MACHTYPE
echo ${BASH_VERSINFO[5]}
x86_64-pc-linux-gnu

Documentation / Reference





Discover More
Bash Liste Des Attaques Ovh
Bash - For Statement

The for statement in bash forloop statements of Bash With a file. Locate returns a list of file in one line separated by a space. This code use then the loop array loop with the Bash version...
Bash Liste Des Attaques Ovh
Bash - Parameter Expansion

Parameter expansion are patterns applied to the parameters that have different results. Same as ?? See also: The value of parameter is substituted where: the braces are optional. They served...
Bash Liste Des Attaques Ovh
How to use the Array Variable in Bash?

Bash provides a one-dimensional array variables. See also: When calling a function, quote the variable otherwise bash will not see the string as atomic. The separator is variable $IFS. There is: ...



Share this page:
Follow us:
Task Runner