title: Retreive specific values from file
body: <p>I have a file test.cf containing:</p>
  <pre><code>   process {
  
          withName : teq {
  
              file = &quot;/path/to/teq-0.20.9.txt&quot;
  
          }
  
      }
  
     process {
  
          withName : cad {
  
              file = &quot;/path/to/cad-4.0.txt&quot;
  
          }
  
      }
  
     process {
  
          withName : sik {
  
              file = &quot;/path/to/sik-20.0.txt&quot;
  
          }
  
      }
  </code></pre>
  <p>I would like to retreive value associated at the end of the file for teq, cad and sik</p>
  <p>I was first thinking about something like</p>
  <pre><code>grep -E 'teq' test.cf
  </code></pre>
  <p>and get only second raw and then remove part of recurrence in line</p>
  <p>But it may be easier to do something like:</p>
  <pre><code>for a in test.cf
  do 
  line=$(sed -n '{$a}p' test.cf)
  
  if line=teq
  #next line using sed -n?
      do print nextline &amp;&gt; teq.txt
  else if line=cad
      do print nextline &amp;&gt; cad.txt
  else if line=sik
      do print nextline &amp;&gt; sik.txt
  done
  </code></pre>
  <p>(obviously it doesn't work)</p>
  <p>EDIT:</p>
  <p>output wanted:
  teq.txt containing <code>teq-0.20.9</code>, cad.txt containing <code>cad-4.0</code> and sik.txt containing <code>sik-20.0</code></p>
  <p>Is there a good way to do that? Thank you for your comments</p>