awk输出儒略日
echo 2020 12 31 23 59 59 | awk '{print strftime("%j",mktime($1" "$2" "$3" "$4" "$5" "$6)) }'
格式化输出,以实现不同的行对齐
$ cat data.tmp | awk 'BEGIN{OFS="\t"} {printf ("%4d %2d %2d %3d %2d %2d %2d %6.3f %7.3f %7.3f %3.2f\n",$1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11)}' > out.lst
本文来自博客园,作者:Philbert,转载请注明原文链接:https://www.cnblogs.com/liangxuran/p/14196630.html