支持大小写替换的bash(包括次要版本)的最低版本是多少?

时间:2015-02-09 16:03:05

标签: bash

由此,我的意思是内置的bash字符串运算符${lowercase^^}${uppercase,,}。我只是想知道支持它的最低版本是什么。谷歌搜索表示版本4.x.但什么是版本.x?版本4.3.1或4.0?

http://www.gnu.org/software/bash/

似乎没有更改日志

1 个答案:

答案 0 :(得分:3)

它在4.0中添加。请参阅Bash源代码中的NEWS文件:

This is a terse description of the new features added to bash-4.0 since
the release of bash-3.2.  As always, the manual page (doc/bash.1) is
the place to look for complete descriptions

... ...

hh. There are new case-modifying word expansions: uppercase (^[^]) and
    lowercase (,[,]).  They can work on either the first character or
    array element, or globally.  They accept an optional shell pattern
    that determines which characters to modify.  There is an optionally-
    configured feature to include capitalization operators.