Re: bash quoting
- From: Bill Marcum <marcumbill@xxxxxxxxxxxxx>
- Date: Thu, 7 Feb 2008 13:26:36 -0500
On 2008-02-07, jergendutch@xxxxxxxxx <jergendutch@xxxxxxxxx> wrote:
Hello,
I would like to run:
wget --header='Key: value' http://HOST/path
for three hosts.
I have a loop:
for i in one two three; do
wget --header='Key: value' http://$i/path
done
The path is really long, so I tidied it up:
WGET="wget --header='Key: value'"
for i in one two three; do
$WGET http://$i/path
done
This doesn't do what I expected: it also tries to fetch "Key: " as if
it is a url.
Using set -x shows me that the 'Key: value' gets split into two on the
space.
No combination of backslashes or different quotes seems to fix this.
What am I doing wrong?
Thanks.
eval $WGET http://$i/path
.
- References:
- bash quoting
- From: jergendutch
- bash quoting
- Prev by Date: Script in process list
- Next by Date: Re: How often does NAGIOS wake up?
- Previous by thread: Re: bash quoting
- Next by thread: Altering source ports for Applications
- Index(es):
Relevant Pages
|