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