echo hello | tr 'a-z' 'A-Z' 瞬间全变大写,tr 还能 -d 删掉指定字符、-s 把重复字符压成一个,配合管道给文本先洗一遍再处理。
echo hello | tr 'a-z' 'A-Z'