awk assistance

Dan Coutu coutu at snowy-owl.com
Thu Nov 14 08:32:11 EST 2002


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:


find / -type f | while read f; do basename $f; done\
 | sort | uniq


The nice thing about this approach is that it uses NO code
of any sort. 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.

-- 

Dan Coutu
Managing Director
Snowy Owl Internet Consulting, LLC
http://www.snowy-owl.com/
Mobile: 603-759-3885
Fax: 603-673-6676





More information about the gnhlug-discuss mailing list