- 论坛徽章:
- 145
|
本帖最后由 jason680 于 2014-03-31 10:48 编辑
回复 1# mazuju099
How about this way
$ awk '{if(NF==1){S=substr(S,1,45)$1""substr(S,55);k=$1}else{S=$0;k=$6};gsub("[^*]+\\*","",k);if(NR==1)k="0";a[k]=a[k]S"\n"}END{t=asorti(a,b);for(n=1;n<=t;n++){printf a[b[n]]}}' FILE
JOBID USER STAT QUEUE FROM_HOST EXEC_HOST JOB_NAME SUBMIT_TIME
18255 test2 RUN publicq console1.fj 32*c01n01 job3 Mar 31 09:37
18258 test2 RUN publicq console1.fj 32*c01n02 job3 Mar 31 09:37
18314 test2 RUN publicq console1.fj 16*c01n03 jobSe Mar 31 09:49
1320 test3 RUN publicq console1.fj 16*c01n04 *jf >log Mar 26 11:03
18269 test2 RUN publicq console1.fj 32*c01n05 job3 Mar 31 09:42
9496 test3 RUN publicq c10n02 24*c01n06 *sp >log;~ Mar 29 00:14
16274 test1 RUN publicq console1.fj 16*c01n07 21-bandh Mar 30 21:26
18307 test2 RUN publicq console1.fj 16*c01n07 jobSe Mar 31 09:47
18262 test2 RUN publicq console1.fj 32*c02n01 job3 Mar 31 09:38
18319 test2 RUN publicq console1.fj 16*c02n02 jobSe Mar 31 09:51
18320 test2 RUN publicq console1.fj 16*c02n02 jobSe Mar 31 09:51
11724 test1 RUN publicq console1.fj 16*c02n03 23-bandh Mar 29 16:24
11724 test1 RUN publicq console1.fj 16*c02n04 23-bandh Mar 29 16:24
16095 test2 RUN publicq console1.fj 16*c02n05 jobname Mar 30 20:25
18268 test2 RUN publicq console1.fj 32*c02n06 job3 Mar 31 09:42
997 test2 RUN publicq console1.fj c02n07 g09-tddft Mar 23 21:10
...
|
|