Re: Shell Question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



In article <20070319223304.57032.qmail@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Al Sparks <data345@xxxxxxxxx> wrote:
> So I list out some directories, and I redirect the output to a file
> called "out".
> 
> I do it with:
>    find . \( -type d ! -name . -prune \)' > out
> 
> I then go into "out" using my favorite editor and remove any
> directories I don't want to search.
> 
> When I do a 
>    find `cat out` -name 'something*'
> 
> I get an error on any directories with whitespace in them.  When I try
> to place quotes around that name, it doesn't work, nor does putting a
> backslash in front of the space help.
> 
> Any shell experts out there have any ideas?

Try replacing the second find with:

cat out | while read d; do find "$d" -name 'something*'; done

Cheers
Tony
-- 
Tony Mountifield
Work: tony@xxxxxxxxxxxxx - http://www.softins.co.uk
Play: tony@xxxxxxxxxxxxxxx - http://tony.mountifield.org
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux