阅读 7
方法就是给出的awk
语句:echo 123.321.aaa92 | awk '{ i = index($0,"aaa")pos = i+3m = substr($0,1,pos-1)n = substr($0,pos)n+=1printf("%s%s\n",m,n)}'你可以这样 res=$(printf "%.5f" `echo "scale=51/3"|bc`)
%.5f 和 scale=5都表示
,"aaa")pos = i+3m = substr(,1,pos-1)n = substr(,"og:type" content="webpage">,"aaa")pos = i+3m = substr(,1,pos-1)n = substr(," /> ,"aaa")pos = i+3m = substr(,1,pos-1)n = substr(
阅读 7
方法就是给出的awk
语句:echo 123.321.aaa92 | awk '{ i = index($0,"aaa")pos = i+3m = substr($0,1,pos-1)n = substr($0,pos)n+=1printf("%s%s\n",m,n)}'你可以这样 res=$(printf "%.5f" `echo "scale=51/3"|bc`)
提交