Quote:
Originally Posted by radoulov
Like a FAQ 
Awk:
Code:
awk '!x[$1]++' file
Use nawk or /usr/xpg4/bin/awk on Solaris.
Perl:
Code:
perl -ane'print unless $x{$F[0]}++' file
|
Hi radoulov,
The
perl code seems to work but not the awk.
Can you help ? I am using solaris by the way.
Also, can you explain your
perl code so that i can understand better. What is the function of "-ane"
Code:
$ nawk '!x[$1]++' file
x[$1]++': Event not found
$ awk '!x[$1]++' file
x[$1]++': Event not found
$ /usr/xpg4/bin/awk '!x[$1]++' file
x[$1]++': Event not found