shell 字符串提取数字

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

这样就可以提取出2014721

posted @ 2018-09-17 21:38  anobscureretreat  阅读(1251)  评论(0编辑  收藏  举报