Sed

From Anthony Pastor Wiki Notes - Verba volant, scripta manent
Revision as of 23:37, 20 April 2015 by Anthoanthop (talk | contribs) (Created page with "Print a pattern between two words (exclusive): <syntaxhighlight lang="bash"> $ ./ovh-api-bash-client.sh --url "/ip/45.102.38.141" 200 {"organisationId":null,"country":"fr","r...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Print a pattern between two words (exclusive):

$ ./ovh-api-bash-client.sh --url "/ip/45.102.38.141"
200 {"organisationId":null,"country":"fr","routedTo":{"serviceName":"ns612429.ip-45-102-38.eu"},"ip":"45.102.38.141/32","canBeTerminated":true,"type":"failover","description":null}

$ ./ovh-api-bash-client.sh --url "/ip/45.102.38.141" | sed -e 's/.*serviceName":"//' -e 's/"},"ip":.*$//'
ns612429.ip-45-102-38.eu