Re: How to pass variable to wget ?
On 22/01/12 22:27, J. Bakshi wrote:
> Dear list,
>
>
> 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
Try:-
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 ? Even the command substitution does not work inside
> wget -O - ...............
>
> Thanks
>
>
NOTE: not tested
Cheers
--
Iceweasel/Firefox extensions for finding answers to Debian questions:-
https://addons.mozilla.org/en-US/firefox/collections/Scott_Ferguson/debian/
NOTE: new update available for Debian Buttons
(New button for querying Debian Developer Package):-
https://addons.mozilla.org/en-US/firefox/addon/debian-buttons/
Reply to: