awk assistance

pll at lanminds.com pll at lanminds.com
Thu Nov 14 13:30:03 EST 2002


In a message dated: Thu, 14 Nov 2002 08:32:11 EST
Dan Coutu said:

>Michael O'Donnell wrote:
>
>> find / -type f | while read f; do basename $f; done
>> 
>
>
>This does not meet the requirement of providing UNIQUE
>
>instances of filenames though. Easily fixed by piping it
>through sort and then uniq ala:

Why the need for both sort and uniq?  If all you care about is 
uniqueness, then use uniq with it's various switches.  If you need it 
sorted and unique, then use sort -u.  That cuts down on a process.

>If using awk is the 'old' way then this approach
>must be the 'ancient' way since it actually uses the original
>UNIX design thinking of pipes and filters that often gets lost
>nowadays.

I don't agree that this is an 'ancient' way.  The OP asked about an 
awk solution, which compared to perl, I consider to be 'old' since 
perl has for almost all instances, replaced the complete 
functionality of awk.

Pipelining is a design feature of the UNIX Philosophy, and therefore, 
tantamount to  "THE way", which never actually ages :)

It's like the difference in musin between an "oldie" and a "classic".
Pipelining is "classic" whereas awk is an "oldie".

Of course, the determination of what qualifies as a "classic" vs. an 
"oldie' depends completely upon who is making that determination :)
-- 

Seeya,
Paul
--
	It may look like I'm just sitting here doing nothing,
   but I'm really actively waiting for all my problems to go away.

	 If you're not having fun, you're not doing it right!





More information about the gnhlug-discuss mailing list