shell命令,从字符串中提取数字

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

这样就可以提取出2014721

猜你喜欢

转载自www.cnblogs.com/jiu0821/p/10760256.html