Re: Handle paths with spaces

2010-01-08 Thread Jon Dowland
On Thu, Jan 07, 2010 at 08:35:56AM -0800, Bob McGowan wrote: > Doesn't work - bash and the 'for' loop work on newline > terminated strings and don't know how to handle the null > terminator from -print0: That's why I said > > Look at the -print0 arg for find and the -0 argument for > > xargs. Yo

Re: Handle paths with spaces

2010-01-07 Thread Boyd Stephen Smith Jr.
In <4b460d6c.3050...@symantec.com>, Bob McGowan wrote: >Jon Dowland wrote: >> On Thu, Jan 07, 2010 at 03:38:23PM +0530, Foss User wrote: >>> I want to do some operation on each file ending with .txt. However, >>> this script wouldn't work because in each iteration it gets one word >>> from the outp

Re: Handle paths with spaces

2010-01-07 Thread Boyd Stephen Smith Jr.
In <3f8297b21001070208q640b8abdudc0bda752f887...@mail.gmail.com>, Foss User wrote: >This is my directory structure: >. >| a.sh >| a.txt >+---foo bar >| b.txt >+---santa >| | c.txt >| \---humpty dumpty >| e.txt >\---test >d.txt > >I want to do some operation on eac

Re: Handle paths with spaces

2010-01-07 Thread Bob McGowan
Jon Dowland wrote: > On Thu, Jan 07, 2010 at 03:38:23PM +0530, Foss User wrote: >> I want to do some operation on each file ending with .txt. However, >> this script wouldn't work because in each iteration it gets one word >> from the output of find. > > Did you read my reply to your last question

Re: Handle paths with spaces

2010-01-07 Thread Jon Dowland
On Thu, Jan 07, 2010 at 03:38:23PM +0530, Foss User wrote: > I want to do some operation on each file ending with .txt. However, > this script wouldn't work because in each iteration it gets one word > from the output of find. Did you read my reply to your last question?

Re: Handle paths with spaces

2010-01-07 Thread Alex Samad
On Thu, Jan 07, 2010 at 03:38:23PM +0530, Foss User wrote: > This is my directory structure: > . > | a.sh > | a.txt > | > +---foo bar > | b.txt > | > +---santa > | | c.txt > | | > | \---humpty dumpty > | e.txt > | > \---test > d.txt > > I want to do some operati

Re: Handle paths with spaces

2010-01-07 Thread Javier Barroso
On Thu, Jan 7, 2010 at 11:08 AM, Foss User wrote: > This is my directory structure: > . > |   a.sh > |   a.txt > | > +---foo bar > |       b.txt > | > +---santa > |   |   c.txt > |   | > |   \---humpty dumpty > |           e.txt > | > \---test >        d.txt > > I want to do some operation on each

Handle paths with spaces

2010-01-07 Thread Foss User
This is my directory structure: . | a.sh | a.txt | +---foo bar | b.txt | +---santa | | c.txt | | | \---humpty dumpty | e.txt | \---test d.txt I want to do some operation on each file ending with .txt. However, this script wouldn't work because in each iteration