> shell编程 >

shell 去掉字符串中的字母

文件:

cat file | tr -d "a-zA-Z">new_file


变量:

new_str=$(echo $str | tr -d "a-zA-Z") (责任编辑:IT)