Здравствуйте.
Где ошибка?
#!/bin/bash
uri='http://example.com'
headers='-H "Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.6 (like Gecko) (Kubuntu)"'
curl -v -I $headers "$uri"
Вывод:
$ ./get_curl_test
* Rebuilt URL to: (compatible;/
* Could not resolve host: (compatible;
* Closing connection 0
curl: (6) Could not resolve host: (compatible;
* Could not resolve host: Konqueror
* Closing connection 1
curl: (6) Could not resolve host: Konqueror
* Rebuilt URL to: Linux)/
* Could not resolve host: Linux)
* Closing connection 2
curl: (6) Could not resolve host: Linux)
* Could not resolve host: KHTML
* Closing connection 3
curl: (6) Could not resolve host: KHTML
* Rebuilt URL to: (like/
* Could not resolve host: (like
* Closing connection 4
curl: (6) Could not resolve host: (like
* Rebuilt URL to: Gecko)/
* Could not resolve host: Gecko)
* Closing connection 5
curl: (6) Could not resolve host: Gecko)
* Rebuilt URL to: (Kubuntu)"/
* Could not resolve host: (Kubuntu)"
* Closing connection 6
curl: (6) Could not resolve host: (Kubuntu)"
* Rebuilt URL to: http://example.com/
* Trying 93.184.216.34...
* Connected to example.com (93.184.216.34) port 80 (#7)
> HEAD / HTTP/1.1
> Host: example.com
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Content-Encoding: gzip
Content-Encoding: gzip
< Accept-Ranges: bytes
Accept-Ranges: bytes
< Cache-Control: max-age=604800
Cache-Control: max-age=604800
< Content-Type: text/html
Content-Type: text/html
< Date: Wed, 16 Nov 2016 06:30:42 GMT
Date: Wed, 16 Nov 2016 06:30:42 GMT
< Etag: "359670651+gzip"
Etag: "359670651+gzip"
< Expires: Wed, 23 Nov 2016 06:30:42 GMT
Expires: Wed, 23 Nov 2016 06:30:42 GMT
< Last-Modified: Fri, 09 Aug 2013 23:54:35 GMT
Last-Modified: Fri, 09 Aug 2013 23:54:35 GMT
< Server: ECS (iad/182A)
Server: ECS (iad/182A)
< X-Cache: HIT
X-Cache: HIT
< x-ec-custom-error: 1
x-ec-custom-error: 1
< Content-Length: 606
Content-Length: 606
<
* Connection #7 to host example.com left intact