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

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -