Gentoo Archives: gentoo-user

From: Kevin McCarthy <signals@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] [OT] bash script error
Date: Mon, 09 May 2011 14:18:19
Message-Id: 20110509141653.GB864@woodpecker.gentoo.org
In Reply to: [gentoo-user] [OT] bash script error by Xi Shen
1 On Mon, May 09, 2011 at 01:44:58PM +0800, Xi Shen wrote:
2 > It is not specific to Gentoo. But do not know where to search or post it :)
3 >
4 > My script looks like:
5 >
6 > url="http://mypage"
7 > curl_opts="-x ''"
8 > curl $url -d \"mydata\" $curl_opts
9 >
10 > If I execute it, I got an error from curl, saying it cannot resolve
11 > the proxy ''.
12 >
13
14 While bash arrays probably aren't required for this, the following seems
15 to work OK:
16
17 curl_opts=(-x "")
18 curl $url -d \"mydata\" "${curl_opts[@]}"
19
20 But I'm sure there's a quotes-only solution, too.
21
22 --
23 Kevin McCarthy <signals@g.o>

Replies

Subject Author
Re: [gentoo-user] [OT] bash script error David Haller <gentoo@×××××××.de>