Sed: Difference between revisions
Jump to navigation
Jump to search
Anthoanthop (talk | contribs) No edit summary |
Anthoanthop (talk | contribs) No edit summary |
||
Line 3: | Line 3: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
$ ./ovh-api-bash-client.sh --url "/ip/45.102.38.141" | $ ./ovh-api-bash-client.sh --url "/ip/45.102.38.141" | ||
</syntaxhighlight> | |||
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} | 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} | ||
<syntaxhighlight lang="bash"> | |||
$ ./ovh-api-bash-client.sh --url "/ip/45.102.38.141" | sed -e 's/.*serviceName":"//' -e 's/"},"ip":.*$//' | $ ./ovh-api-bash-client.sh --url "/ip/45.102.38.141" | sed -e 's/.*serviceName":"//' -e 's/"},"ip":.*$//' | ||
</syntaxhighlight> | |||
ns612429.ip-45-102-38.eu | ns612429.ip-45-102-38.eu | ||
Revision as of 23:38, 20 April 2015
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