2

我在 Windows 中使用 wget,它与基本的 http 请求配合得很好,但是当我运行下面的命令时,它基本上是 snom 手机上的操作 URL。它不运行它并在链接下方给我消息。有谁知道如何解决这个问题?

操作网址:

 http://Phone-IP-Address/dummy.htm?settings=save&setting_server=http://WEB-Server-IP/settings.xml&store_settings&=save

结果

syswgetrc = C:\Program Files (x86)\GnuWin32/etc/wgetrc
--2013-03-12 10:10:53--  
Connecting to `192.168.1.100:80`... connected.
HTTP request sent, awaiting response... 200 Ok
Length: 0 [text/html]
Saving to: `dummy.htm@settings=save'

[ <=>                                   ] 0           --.-K/s   in 0s

2013-03-12 10:10:53 (0.00 B/s) - `dummy.htm@settings=save' saved [0/0]

'setting_server' is not recognized as an internal or external command, operable program or batch file.
'store_settings' is not recognized as an internal or external command, operable program or batch file.
4

1 回答 1

0

Windows中的&字符是一个特殊字符,告诉 shell 在一行中执行多个命令。所以你必须用双引号将你的 URL 括起来:

"http://Phone-IP-Address/dummy.htm?settings=save&setting_server=http://WEB-Server-IP/settings.xml&store_settings&=save"

这样,shell 不会尝试将其作为命令的一部分进行解析,而是将其视为单个参数、单个字符串 blob,因此&字符也不会被视为命令分隔符...

它在Linux 中也有特殊的含义:

  • 一个将在后台异步运行命令
  • &&表示逻辑与
于 2013-03-12T09:11:59.343 回答