Shell Curl在一个命令中指定多个运行时重建URL

Shell Curl在一个命令中指定多个运行时重建URL,shell,curl,Shell,Curl,我尝试运行curl命令5次,如下面的示例所示,结果出现错误。有人能解释一下我做错了什么吗 命令: curl http://google.com {1..5} -v 输出: * Rebuilt URL to: http://google.com/ * Trying 172.217.164.110... * TCP_NODELAY set * Connected to google.com (172.217.164.110) port 80 (#0) > GET / HTTP/1.1 &

我尝试运行curl命令5次,如下面的示例所示,结果出现错误。有人能解释一下我做错了什么吗

命令:

curl http://google.com {1..5} -v
输出:

* Rebuilt URL to: http://google.com/
*   Trying 172.217.164.110...
* TCP_NODELAY set
* Connected to google.com (172.217.164.110) port 80 (#0)
> GET / HTTP/1.1
> Host: google.com
> User-Agent: curl/7.52.1
> Accept: */*
> 
< HTTP/1.1 301 Moved Permanently
< Location: http://www.google.com/
< Content-Type: text/html; charset=UTF-8
< Date: Tue, 22 Jan 2019 19:57:19 GMT
< Expires: Thu, 21 Feb 2019 19:57:19 GMT
< Cache-Control: public, max-age=2592000
< Server: gws
< Content-Length: 219
< X-XSS-Protection: 1; mode=block
< X-Frame-Options: SAMEORIGIN
< 
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>
* Curl_http_done: called premature == 0
* Connection #0 to host google.com left intact
* Rebuilt URL to: 1/
*   Trying 0.0.0.1...
* TCP_NODELAY set
* Immediate connect fail for 0.0.0.1: No route to host
* Closing connection 1
curl: (7) Couldn't connect to server
* Rebuilt URL to: 2/
*   Trying 0.0.0.2...
* TCP_NODELAY set
* Immediate connect fail for 0.0.0.2: No route to host
* Closing connection 2
curl: (7) Couldn't connect to server
* Rebuilt URL to: 3/
*   Trying 0.0.0.3...
* TCP_NODELAY set
* Immediate connect fail for 0.0.0.3: No route to host
* Closing connection 3
curl: (7) Couldn't connect to server
* Rebuilt URL to: 4/
*   Trying 0.0.0.4...
* TCP_NODELAY set
* Immediate connect fail for 0.0.0.4: No route to host
* Closing connection 4
curl: (7) Couldn't connect to server
* Rebuilt URL to: 5/
*   Trying 0.0.0.5...
* TCP_NODELAY set
* Immediate connect fail for 0.0.0.5: No route to host
* Closing connection 5
curl: (7) Couldn't connect to server
*重建的URL到:http://google.com/
*正在尝试172.217.164.110。。。
*TCP_节点集
*已连接到google.com(172.217.164.110)端口80(#0)
>GET/HTTP/1.1
>主持人:google.com
>用户代理:curl/7.52.1
>接受:*/*
> 
命令
curlhttp://google.com {1..5}-v
不会告诉curl向您的URL发出5个请求

该命令的结果是:

curl http://google.com 1 2 3 4 5 -v
初始请求有效,但接下来的5个URL无效

您正在寻找:

curl http://google.com http://google.com http://google.com http://google.com http://google.com
或bash循环:

for i in `seq 1 5` ; do
    curl http://google.com -v
done

谢谢你指出这一点。我忽略了外壳的扩展。