public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* Re: [gentoo-user] [OT] bash script error
@ 2011-05-09 10:45 JDM
  2011-05-10 22:30 ` David Haller
  0 siblings, 1 reply; 17+ messages in thread
From: JDM @ 2011-05-09 10:45 UTC (permalink / raw
  To: gentoo-user

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 <davidshen84@googlemail.com>
> wrote:

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

> > > On 2011-05-09, Xi Shen <davidshen84@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

^ permalink raw reply	[flat|nested] 17+ messages in thread
* [gentoo-user] [OT] bash script error
@ 2011-05-09  5:44 Xi Shen
  2011-05-09  6:43 ` Nils Andresen
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Xi Shen @ 2011-05-09  5:44 UTC (permalink / raw
  To: gentoo-user

It is not specific to Gentoo. But do not know where to search or post it :)

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.


-- 
Best Regards,
Xi Shen (David)

http://twitter.com/davidshen84/



^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2011-05-10 23:00 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-09 10:45 [gentoo-user] [OT] bash script error JDM
2011-05-10 22:30 ` David Haller
  -- strict thread matches above, loose matches on Subject: below --
2011-05-09  5:44 Xi Shen
2011-05-09  6:43 ` Nils Andresen
2011-05-09  7:48   ` Xi Shen
2011-05-09  7:52   ` Kfir Lavi
2011-05-09  8:14     ` Xi Shen
2011-05-09  8:23       ` Xi Shen
2011-05-09  8:30       ` Pandu Poluan
2011-05-09  8:31 ` Pandu Poluan
2011-05-09  9:00   ` Xi Shen
2011-05-09  9:25     ` Kfir Lavi
2011-05-09 10:36       ` Alex Schuster
2011-05-09 12:06         ` Kfir Lavi
2011-05-09 12:57 ` BRM
2011-05-09 14:16 ` Kevin McCarthy
2011-05-10 22:57   ` David Haller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox