shell 字符串提取数字

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

这样就可以提取出2014721

原文地址:https://www.cnblogs.com/sea-stream/p/9665087.html