title: Bash: Grab part of string from a command line output
body: <p>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.</p>
  
  <p>I run the command ebi-describe-env. </p>
  
  <p>My output as follows:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>I want to grab the '<code>20120831 - daily</code>' part of the string (this string will always change but stays in the same place) and set it to a variable.</p>
  
  <p>Originally I thought I could use grep or sed and print a line after each '|' and set the 13th line to a variable.</p>
  
  <p>I'm very new to bash scripting, so any help would be great. Thank you.</p>