He

------Original Message------
From: Alex Schuster
To: gentoo-user@lists.gentoo.org
ReplyTo: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] [OT] bash script error
Sent: 9 May 2011 11:36

Kfir Lavi writes:

> On Mon, May 9, 2011 at 12:00 PM, Xi Shen <davidshe...@googlemail.com>
> wrote:

> > On Mon, May 9, 2011 at 4:31 PM, Pandu Poluan <pa...@poluan.info> wrote:

> > > On 2011-05-09, Xi Shen <davidshe...@googlemail.com> wrote:

> > >> My script looks like:
> > >> 
> > >> url="http://mypage";
> > >> curl_opts="-x ''"
> > >> curl $url -d \"mydata\" $curl_opts
> > >> 
> > >> If I execute it, I got an error from curl, saying it cannot resolve
> > >> the proxy ''.
> > >> 
> > >> But If I modify the script to:
> > >> 
> > >> url="http://mypage";
> > >> curl $url -d \"mydata\" -x ''
> > >> 
> > >> It works fine.
> > >> 
> > >> I guess there's something wrong with the argument expansion. Just do
> > >> not know how to fix it. Please help.

Do as you tried first, but add an eval:
eval curl "$url" -d \"mydata\" $curl_opts

> > I have replied you before.
> 
> What I have sent you is the solution to your problems.
> Try to run what I told you.
> I ran it successfully on my comp.
> curl_opts=-x ""

This gives a "command not found" error, as bash tries to execute the empty 
command "". Are you using another shell?

        Wonko



Sent from my BlackBerry® wireless device

Reply via email to