title: How do i store the output of AWK as a variable to use in a SED command in a BASH script?
body: <p>I have used this to create a character string:</p>
  
  <pre><code>awk -F "|" 'NR==1 {print $2$4}' file
  </code></pre>
  
  <p>I now want to use this string to replace another string using SED, using this code, which i know works:</p>
  
  <pre><code>sed -i.bak 's/\(&lt;remote&gt;\).*\(&lt;\/remote&gt;\)/&lt;remote&gt; http:\/\/blabla\/'$var' &lt;\/remote&gt;/g' file2.xml
  </code></pre>
  
  <p>But what i can't figure out is how to save the output of the awk as $var first to use as an input for SED. can anyone help? thanks.</p>