How to find unique lines in a file without using 'uniq' and 'sort' command in k shell...
jks@LILO:~/prac$ cat flo
this is line1
this is line2
this is line3
this is line2
this is line2
this is line5
in place of "uniq" I can use awk, but sort, I have to use
jks@LILO:~/prac$ cat flo | sort | awk 'X !~ $0; {X=$0}'
this is line1
this is line2
this is line3
this is line5
Try:
awk '!($0 in a) {a[$0];print}' file
you teacher has put these restrictions for your assignment?