官术网_书友最值得收藏!

  • Bash Quick Start Guide
  • Tom Ryder
  • 257字
  • 2021-07-23 16:58:53

Identifying the Bash version number

Before we start writing commands and programming with Bash, it's a good idea to find out what version of Bash you have installed. This is because newer versions of Bash have useful new features that might be discussed in this book, but that might not be available in your version of Bash.

You can check the version of your current running shell by printing the value of the BASH_VERSION variable:

bash$ declare -p BASH_VERSION
declare -- BASH_VERSION="4.4.12(1)-release"

You can get the same information by invoking the bash program with its --version option, which provides some extra information about the program's version number and software license:

$ bash --version
GNU bash, version 4.4.12(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2016 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.

The most recent stable minor version of GNU Bash at the time of writing is version 4.4, with version 4.4.0 released in September 2016.

In this book, we will focus on the features of Bash that were available in GNU Bash version 4.0, which was released in 2011, and is very widely available as a minimum version.

If the version of Bash installed on your computer is older than 4.0, some of the scripts and features discussed in this book may not work correctly. You or your system administrator should use your operating system to upgrade your Bash shell to a newer version.

主站蜘蛛池模板: 泸定县| 冀州市| 阿瓦提县| 汨罗市| 宁陵县| 安义县| 汤原县| 瓦房店市| 海淀区| 城口县| 永春县| 南涧| 商城县| 汶川县| 大安市| 峨眉山市| 肥乡县| 阜阳市| 清镇市| 利川市| 吴旗县| 沐川县| 志丹县| 闽侯县| 乌拉特前旗| 日喀则市| 广安市| 邵阳市| 黔西县| 许昌县| 延庆县| 临朐县| 固始县| 江油市| 黑水县| 凤山县| 四子王旗| 罗平县| 达日县| 阿拉善右旗| 桂林市|