I am running a command in CentOS that gives me an output of a multiple line string and I want to grab a certain part of that output and set it to a variable.
For example I run the commandline
ebi-describe-env
My output as follows:
ApplicationName | CNAME | DATECreated | DateUpdated | Description | EndpointURL |
EnvironmentID | EnvironmentName | Health | Stack | Status | TemplateName |
Version Label -------------------------------------
Web App | domain.com | 2012-02-23 | 2012-08-31 | |
anotherdomain.com | e-8sgkf3eqbj | Web-App-Name | Status |
Linux | Ready | N/A | 20120831 - daily
I want to grab the '20120831-daily' part of the multi-string which is in the same place every call and set it to a variable. I believe the '------' means a new line or output.
I'm very new to bash scripting, so any help would be great. Thank you.
Note: I asked the question before and it was solved with awk, but it turned out it was only for a one line output. Previous question