Re: How to pass variable to wget ?
- From: Sven Joachim <svenjoac@xxxxxx>
- Date: Sun, 22 Jan 2012 12:43:55 +0100
On 2012-01-22 12:27 +0100, J. Bakshi wrote:
I have a script which submits a form with wget --post-data
[....]
#!/bin/bash
Uname=xyz
Pword=1234
wget -O - --save-cookies cookies.txt --post-data \
'username=$Uname&password=$Pword' --keep-session-cookies $URL/$AUTHURL 1&>2
[....]
During the test with "bash -x" I see the variables are not evaluated and they appear as
$Uname and $Pword. But if I put an echo for testing at top like
echo $Uname
the value is evaluated correctly.
Am I missing something ?
Yes, the single quotes in your wget command which prevent bash from
expanding the variables. Use double quotes instead, see
http://www.gnu.org/software/bash/manual/bashref.html#Quoting.
Sven
--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx
Archive: http://lists.debian.org/87pqecklms.fsf@xxxxxxxxxxxxx
- Follow-Ups:
- Re: How to pass variable to wget ?
- From: J. Bakshi
- Re: How to pass variable to wget ?
- References:
- How to pass variable to wget ?
- From: J. Bakshi
- How to pass variable to wget ?
- Prev by Date: Dell Inspiron N5010 laptop overheating on Debian 6.0.1, Linux 3.2.3, low CPU usage, radeon GPU driver
- Next by Date: Re: How to pass variable to wget ?
- Previous by thread: How to pass variable to wget ?
- Next by thread: Re: How to pass variable to wget ?
- Index(es):
Relevant Pages
|