Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh adding single quotes as it pleases
- X-seq: zsh-users 14431
- From: "Jerry Rocteur" <macosx@xxxxxxxxxx>
- To: "Peter Stephenson" <pws@xxxxxxx>
- Subject: Re: zsh adding single quotes as it pleases
- Date: Thu, 24 Sep 2009 15:32:10 +0200 (CEST)
- Cc: zsh-users@xxxxxxxxxx
- Importance: Normal
- In-reply-to: <200909241128.n8OBSEkH008973@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <64763.153.98.68.197.1253790454.squirrel@xxxxxxxxxxxxxxxxxxx> <200909241128.n8OBSEkH008973@xxxxxxxxxxxxxx>
> "Jerry Rocteur" wrote:
>> Given a text file like this:
>>
>> cat ll.txt
>> -a p1vkg/Bis1234/"XXXXXXXX XXXXXXX XX"
>> -a r0esmm/Bis1234/"XXX XXX - XXXX"
[[ deleted ]]
>> Gives me
>>
>> [113] + echo -a 'p1vkg/Bis1234/"XXXXXXXX' XXXXXXX 'XX"'
>> -a p1vkg/Bis1234/"XXXXXXXX XXXXXXX XX"
>> [113] + read line
>> [113] + set -x
>> [113] + echo -a 'r0esmm/Bis1234/"XXX' XXX - 'XXXX"'
>> -a r0esmm/Bis1234/"XXX XXX - XXXX"
>> [113] + read line
>>
>> zsh is adding single quotes..
>
> You mean the quotes in the set -x output? The real question is why you
> expect or need that to be different.
I was running a java command line which works well when you type it into the command line. As soon as you put it in a
script it works as if the double quotes were not there .. I run it from a Perl script and it works well.
So I decided to stick the set -x to see what was happening and saw the single quote.
The Java expects to see the line like this:
-a p1vkg/Bis1234/"XXXXXXXX XXXXXXX XX"
If it does not get it exactly like this it fails.. And it fails when I run it the way I describe above.
>> Why does it do that ?
>
> $line contains:
>
> -a p1vkg/Bis1234/"XXXXXXXX XXXXXXX XX"
>
> In ksh mode, this gets split into words on spaces when used as a command
> argument, i.e the words:
>
> -a
> p1vkg/Bis1234/"XXXXXXXX
> XXXXXXX
> XX"
It looks like this is not going to work this way, we will have to do it differently.
Thanks everyone, we'll work around it..
Jerry
Messages sorted by:
Reverse Date,
Date,
Thread,
Author