[ug-bosug] 'find' -maxdepth alternate

Anil Gulecha anil.verve at gmail.com
Mon Jan 22 10:58:35 PST 2007


On 1/23/07, Moinak Ghosh <Moinak.Ghosh at sun.com> wrote:
>
> you'd need to use the following shell snippet:
>
> find . | while read f
> do
>     cnt=`echo $f | sed 's/\// /g' | wc -w`
>     if [ $cnt -lt <maxdepth> ]
>     then
>         echo $f
>     fi
> done
>
> AFAIK there is no direct replacement.


In this case we are traversing the entire structure, just not printing it
out. this is unacceptable as the script will be looking for specific files,
and taring them up.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.opensolaris.org/pipermail/ug-bosug/attachments/20070123/11bbc7e3/attachment.html 


More information about the ug-bosug mailing list