shell判断全部都是数字(shell学习笔记六)

[root@localhost shell_project]# aa=123
[root@localhost shell_project]# bb=$(echo $aa | sed 's/[0-9]//g')
[root@localhost shell_project]# echo $bb

[root@localhost shell_project]#


[root@localhost shell_project]# aa=adc
[root@localhost shell_project]# bb=$(echo $aa | sed 's/[0-9]//g')
[root@localhost shell_project]# echo $bb
adc
[root@localhost shell_project]#



你可能感兴趣的:(系统(linux))