shell 字符串提取数字

echo "2014年7月21日" | tr -cd "[0-9]"

这样就可以提取出2014721

猜你喜欢

转载自www.cnblogs.com/sea-stream/p/9665087.html