001、
root@DESKTOP-1N42TVH:/home/test5/test/test# ls a.txt root@DESKTOP-1N42TVH:/home/test5/test/test# cat a.txt 1570051 1570053 5188621 5178672 5188703 5178724 5188900 5178925 5188932 5179705 root@DESKTOP-1N42TVH:/home/test5/test/test# awk 'BEGIN {tmp = 0} {print $NF - tmp; tmp = $NF}' a.txt 1570051 ## 计算相邻两个数的差 2 3618568 -9949 10031 -9979 10176 -9975 10007 -9227 root@DESKTOP-1N42TVH:/home/test5/test/test# awk 'BEGIN {tmp = 0} {print $NF - tmp; tmp = $NF}' a.txt | sed '1c 0' 0 2 3618568 -9949 10031 -9979 10176 -9975 10007 -9227
原创文章,作者:,如若转载,请注明出处:https://blog.ytso.com/tech/aiops/275344.html