2006/3/14, Anselm R. Garbe <[EMAIL PROTECTED]>:
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?

Indeed. -type f should be sufficient.

hrr

_______________________________________________
[email protected] mailing list
http://wmii.de/cgi-bin/mailman/listinfo/wmii

Reply via email to