1 2 3 4 5 6 7 | File: "simu_space_1.dat" Size: 237928 Blocks: 480 IO Block: 4096 regular Datei Device: 801h/2049d Inode: 2768915 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 1000/ nst) Gid: ( 1000/ nst) Access: 2008-11-14 10:56:05.000000000 +0100 Modify: 2008-11-13 23:26:44.000000000 +0100 Change: 2008-11-13 23:26:44.000000000 +0100 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | BEGIN { n = 0; d1 = 0; s1 = 0; FS = ":|-| *"; } { for(i=1; i<=NF; i++) { if($i~/Modify/) { n = n + 1; d = $(i+4); h = $(i+5); m = $(i+6); s = $(i+7); d1 = d1 + ((-1)**n)*d*24*3600; s1 = s1 + ((-1)**n)*(3600*h + 60*m + s); } } } END { s1 = s1 + d1; D = int(s1/(24*3600)); H = int((s1 - D*24*3600)/3600); M = int((s1-D*24*3600-H*3600)/60); S = s1 % 60; printf("The total time required %d days, %d hours, \ %d minutes and %d seconds\n", D, H, M, S) ; } |
1 | stat simu_space_1.dat simu_space_100.dat | awk -f time_df.awk |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |