From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QJNrH-0000iQ-I6 for garchives@archives.gentoo.org; Mon, 09 May 2011 10:38:35 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CAEE21C018; Mon, 9 May 2011 10:36:49 +0000 (UTC) Received: from mx.virtyou.com (mx.virtyou.com [94.23.166.77]) by pigeon.gentoo.org (Postfix) with ESMTP id 88B6C1C018 for ; Mon, 9 May 2011 10:36:49 +0000 (UTC) Received: from weird.localnet (p5B274EC7.dip.t-dialin.net [91.39.78.199]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx.virtyou.com (Postfix) with ESMTPSA id 28B594A82B0 for ; Mon, 9 May 2011 12:36:48 +0200 (CEST) From: Alex Schuster To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] [OT] bash script error Date: Mon, 9 May 2011 12:36:43 +0200 User-Agent: KMail/1.13.7 (Linux/2.6.38-ck_edid; KDE/4.6.3; x86_64; ; ) References: In-Reply-To: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201105091236.45532.wonko@wonkology.org> X-Archives-Salt: X-Archives-Hash: fdcd303fe99379960a33f5de17fb2a59 Kfir Lavi writes: > On Mon, May 9, 2011 at 12:00 PM, Xi Shen > wrote: > > On Mon, May 9, 2011 at 4:31 PM, Pandu Poluan wrote: > > > On 2011-05-09, Xi Shen 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