linux - Problem removing duplicate files using awk -
contents of part3.1.awk
{ current_line=$0 if (current_line!=prev) { print $1 " -> " " -> " $5 " -> " $8 } prev=$0 }
to list of processes, run in terminal. want output removed duplicates , sorted too.
$ps -ef | awk -f part3.1.awk | sort
what wrong doing?
you sorting output awk script, when want sorting input.
$ps -ef | awk -f part3.1.awk | sort
should be
$ps -ef | sort | awk -f part 3.1.awk
but should tell you don't need awk remove duplicates. sort -u
you, in
ps -ef | sort -u
Comments
Post a Comment