0

解決策を見つけましたが、機能しませんhttp://www.cyberciti.biz/faq/linux-unix-shell-programming-converting-lowercase-uppercase/

[root@mg0016 tmp]# y="this Is A test"
[root@mg0016 tmp]# echo "${y^^}"
-bash: ${y^^}: bad substitution
4

2 に答える 2

2

次のコードのいずれかを使用できます。

$ tr '[:lower:]' '[:upper:]' < input.txt > output.txt

また

$  sed -e 's/\(.*\)/\U\1/' input.txt > output.txt
于 2012-10-11T17:49:43.997 に答える
0

次のものを見つけました!そしてそれは動作します!

[spatel@mg0016 ~]$ echo "lower" | awk '{print toupper($0)}'
LOWER

返信ありがとうございます。

于 2012-10-11T18:38:43.867 に答える