Re: for ... in ... do ignores escape characters

2008-04-18 Thread pk
On Friday 18 April 2008 14:02, Dave Rutherford wrote: > Quotes or escapes in the output of the `` are input to the shell rather > than shell syntax, so won't be interpreted.  You just need to quote more. > > $ foo () { echo sony; echo apple; echo hewlett packard; } > > Now note the difference be

Re: for ... in ... do ignores escape characters

2008-04-18 Thread pk
On Friday 18 April 2008 14:02, Dave Rutherford wrote: > Quotes or escapes in the output of the `` are input to the shell rather > than shell syntax, so won't be interpreted. You just need to quote more. > > $ foo () { echo sony; echo apple; echo hewlett packard; } > > Now note the difference be

Re: for ... in ... do ignores escape characters

2008-04-18 Thread Andreas Schwab
"Dave Rutherford" <[EMAIL PROTECTED]> writes: > Now note the difference between: > > $ for w in "`foo`"; do echo $w; done > sony apple hewlett packard >and > $ for w in `foo`; do echo "$w"; done > sony > apple > hewlett > packard >and > $ for w in "`foo`"; do echo "$w"; done > sony > apple

Re: for ... in ... do ignores escape characters

2008-04-18 Thread Dave Rutherford
On Thu, Apr 17, 2008 at 4:21 PM, luiscolorado <[EMAIL PROTECTED]> wrote: > Hello, everybody... I'm suffering a huge problem with the "for" command > because it wants to parse a variable ignoring escape characters. > > For example, as you know, if I do something like this in bash: > > for i in s

Re: for ... in ... do ignores escape characters

2008-04-17 Thread Paul Jarc
luiscolorado <[EMAIL PROTECTED]> wrote: > This is what I get when some file names have spaces: > > for i in `my-program` > do > echo $i > done > > It echoes the following: > > sony > apple > hewlett > packard Unquoted `` expansions are split into words using $IFS. So if you only want to split on

for ... in ... do ignores escape characters

2008-04-17 Thread luiscolorado
de generates the following: "sony" "apple" "hewlett packard" That is, it ignores the quotes! I also tried using \ to escape the spaces, and I got something like the following: sony apple hewlett\ packard Any ideas? Thanks a bunch! Luis -- View this message in