我搜索了SO,发现将下面的字符串大写即可
str="Some string"
echo ${str^^}
但是我试图在命令行参数上做类似的事情,这给了我以下错误
试过了
#!/bin/bash
## Output
echo ${1^^} ## line 3: ${1^^}: bad substitution
echo {$1^^} ## No error, but output was still smaller case i.e. no effect
我们该怎么做?
bash
吗?