hariudkmr
hariudkmr

Reputation: 337

wget command working in linux but not working in windows

I am trying to control IP Power Switch 9258 using wget command. using the ubuntu machine's wget i am able to power on and power off the IP Switch.

But if i use the same command in windows(GNU Wget 1.11 version) i am unable to turn on or turn off the ip power switch(IP 9258)

"wget http://admin:12345678\@192.168.0.49/Set.cmd?CMD=SetPower+P62=0;"


 D:\GIT\fence_ip9258>wget http://admin:12345678\@192.168.1.41/Set.cmd?CMD=SetPowe
r+P63=0
SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc
syswgetrc = C:\Program Files\GnuWin32/etc/wgetrc
--2014-06-12 19:12:59--  http://admin:*password*@192.168.1.41/Set.cmd?CMD=SetPow
er+P63=0
Connecting to 192.168.1.41:80... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Connecting to 192.168.1.41:80... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Authorization failed.

Just trying to understand what is happening here, Thanks in advance for your insight in understanding the problem

Regards Hari

Upvotes: 0

Views: 880

Answers (2)

hariudkmr
hariudkmr

Reputation: 337

The issue is the backslash before @.

D:\GIT\fence_ip9258>wget http://admin:[email protected]/Set.cmd?CMD=SetPower
+P63=1
SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc
syswgetrc = C:\Program Files\GnuWin32/etc/wgetrc
--2014-06-12 19:14:47--  http://admin:*password*@192.168.1.41/Set.cmd?CMD=SetPow
er+P63=1
Connecting to 192.168.1.41:80... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Connecting to 192.168.1.41:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified
Saving to: `Set.cmd@CMD=SetPower+P63=1'

    [ <=>                                   ] 58           311B/s   in 0.2s

2014-06-12 19:14:48 (311 B/s) - `Set.cmd@CMD=SetPower+P63=1' saved [58]

Upvotes: 0

Oleg
Oleg

Reputation: 1036

The problem could be in the escaping the '@' character. In linux shells, any character can be escaped, including characters that don't need escapement. For example, "echo \@" and "echo @" produce the same result: '@'. In Windows shell, "echo @" produces '@', but "echo \@" produces "\@". Just remove that backslash.

Upvotes: 2

Related Questions