i was trying to write a script to format output of a command in ksh which has output as below:
Quote:
jobname mm/dd/yy hh:mm:ss mm/dd/yy hh:mm:ss status run_number exit_code
so i used :
Quote:
command | awk '{ print ""$1" \t\t",$2" ",$3" ",$4" ",$5" ",$6}'
to get
Quote:
jobname mm/dd/yy hh:mm:ss mm/dd/yy hh:mm:ss status
which i require at all times. But problem occurs when status part changes. above output i get when status is SU (success).If the status is IN (inactive), output of command is:
Quote:
jobname ----- mm/dd/yy hh:mm:ss IN run_number exit_code
and if status is RU (running), output of command is
Quote:
jobname mm/dd/yy hh:mm:ss ----- RU run_number exit_code
and if status is AC (activated), output of command is
Quote:
jobname ----- ----- AC run_number exit_code
the awk construct that i use is ok for SU status, i need an awk construct that gives similar output for all status. Something like :
or
Quote:
jobname mm/dd/yy hh:mm:ss ----- RU
or
Quote:
jobname ----- mm/dd/yy hh:mm:ss IN
or
Quote:
jobname mm/dd/yy hh:mm:ss mm/dd/yy hh:mm:ss SU
i got my construct to work with th SU status alone, i wanted to have one single awk construct that handles all the status. Can someone help me in the code ?