I am running a command in CentOS that gives me an output of a string and I want to grab a certain part of that output and set it to a variable.
I run the command 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 string (this string will always change but stays in the same place) and set it to a variable.
Originally I thought I could use grep or sed and print a line after each '|' and set the 13th line to a variable.
I'm very new to bash scripting, so any help would be great. Thank you.