hello,
command produces output with many lines as on example:
Code:
No filesets which have fixes for IV00149 are currently installed.
All filesets for IV00151 were found.
[red]All filesets for 71-01-031207_SP were found.
All filesets for 71-00-041140_SP were found.
All filesets for 71-01-021150_SP were found.[/red]
I need to get the biggest "value" in column 4 for lines like matched in red.
here are commands which seems to do the job:
Code:
# nim -o fix_query 710spot_res|grep -E '( [0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9]_.. )'|awk 'BEGIN {max = 0} {if ($4>max) max=$4} END {print max}'
71-01-041216_SP
# nim -o fix_query 710spot_res|awk 'NF==6&&$1=="All"&&$2=="filesets"&&$3=="for"&&$5=="were"&&$6=="found."&&$4~/^[0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9]_..$/{print $4}'|sort -n|tail -1
71-01-041216_SP
is there any easier way? e.g. single awk 'oneliner' without multiple piping?