Monday, January 18, 2010

SED Tips

Sed: Search text and display

sed -n '/404 Not Found/,/405 Method Not Allowed/p' rfc2616.txt

This searches the rfc2616.txt T, for the pattern 404 Not Found till 405 Method Not Allowed is found, then displays.

source: http://www.faqs.org/rfcs/rfc2616.txt

sed -n '/404 Not Found/,/405 Method Not Allowed/p' rfc2616.txt

10.4.5 404 Not Found ...........................................66
10.4.6 405 Method Not Allowed ..................................66
10.4.5 404 Not Found

The server has not found anything matching the Request-URI. No
indication is given of whether the condition is temporary or
permanent. The 410 (Gone) status code SHOULD be used if the server
knows, through some internally configurable mechanism, that an old
resource is permanently unavailable and has no forwarding address.
This status code is commonly used when the server does not wish to
reveal exactly why the request has been refused, or when no other
response is applicable.

10.4.6 405 Method Not Allowed

No comments:

Post a Comment