A
A
Alexey Yarkov2016-07-02 02:12:24
linux
Alexey Yarkov, 2016-07-02 02:12:24

How to list strings with grep?

$ curl -s --head -X GET "http://127.0.0.1:3000" | echo `grep '^X-'`

HTTP/1.1 200 OK
X-DNS-Prefetch-Control: off
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Download-Options: noopen
X-XSS-Protection: 1; mode=block
Access-Control-Allow-Origin: *
Accept-Ranges: bytes
Cache-Control: public, max-age=0
Last-Modified: Fri, 01 Jul 2016 21:47:29 GMT
ETag: W/"3687-155a86e4d6b"
Content-Type: text/html; charset=UTF-8
Content-Length: 13959
Vary: Accept-Encoding
Date: Fri, 01 Jul 2016 23:01:44 GMT
Connection: keep-alive

# выводит только последнюю строку
X-XSS-Protection: 1; mode=block

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2016-07-02
@yarkov

$ curl -s --head -X GET "http://127.0.0.1:3000" | grep '^X-'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question