Re: [wmii] snap: 20060313, proglist() spike

From: Anselm R. Garbe <garbeam_AT_wmii.de>
Date: Tue, 14 Mar 2006 10:03:13 +0100

On Tue, Mar 14, 2006 at 09:56:33AM +0100, Bartosz Trudnowski wrote:
> 2006/3/14, Anselm R. Garbe <garbeam_AT_wmii.de>:
> >
> > On Mon, Mar 13, 2006 at 12:27:01PM -0800, Suraj N. Kurapati wrote:
> > > Suraj N. Kurapati wrote:
> > > > echo "$PATH" | tr ':' '\n' | grep -v '^$' | sort -u | while read
> > > > dir; do find "$dir" -perm -u+x -type f -print | sed 's,^.*/,,'; done
> > > > | sort -u
> > >
> > > Whoops, a small correction (\! -type d):
> > >
> > > echo "$PATH" | tr ':' '\n' | grep -v '^$' | sort -u | while read
> > > dir; do find "$dir" -perm -u+x \! -type d -print | sed 's,^.*/,,';
> > > done | sort -u
> >
> > Can someone confirm if that works on BSD? Why are there two
> > 'sort -u' filters?
>
>
> First sort ensures, that there is no duplicates in PATH.
>
> The find args and the sort -u arg smell like a gnu...
>
>
> Solaris sort support this switch. Anyway - you can replace this with 'sort |
> uniq'.
>
> \! looks
> > very strange. What is wrong with -type f?

Well, I applied following version now:

proglist() {
        echo "$@" | tr ':' '\n' | grep -v '^$' | uniq |
        while read dir
        do
                find "$dir" -perm -u+x -type f -print | sed 's,^.*/,,'
        done | sort | uniq
}

Regards,

-- 
 Anselm R. Garbe  ><><  www.ebrag.de  ><><  GPG key: 0D73F361
Received on Tue Mar 14 2006 - 10:03:13 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 16:01:09 UTC