title: Assign a Shell variable in AWK
body: <p>I have strings like this </p>
  
  <pre><code>/home/rm/home-scripts/originals/audicerttest/incoming/TEST040511.txt
  /home/rm/home-scripts/originals/audicerttest2/incoming/TEST040512.txt
  /home/rm/home-scripts/originals/audicerttest3/incoming/TEST040513.txt
  </code></pre>
  
  <p>etc..I want to extract strings 'audicerttest/incoming', audicerttest2/incoming' etc into a shell variable and use it later in the script. I tried something like this.</p>
  
  <pre><code>for file in `find ${ROOT}/* -type f | grep -v -f test.txt`
  do
  let count++
  echo ${count}: ${file}
  echo ${file} | eval $(awk '{split($0,a,"/"); print "abc=a[6]/a[7]"}' &lt; /dev/null)
  echo abc====$abc
  done
  </code></pre>
  
  <p>but its not giving any output for abc. </p>