title: unable to store multiple sed operations using pipe in a variable
body: <p>I am not able to execute a multiple sed statement using pipe filters in a variable. 
  i am trying to extract a path from a file and then working on that path to change a few letters within the path by going through another sed statement.</p>
  
  <p>the code looks like this: </p>
  
  <pre><code>for i in 1 2 3 4 5 6 7
  do
    for j in F E I D
    do
    cpath="`sed -n "11,11p" &lt;path.cfg | sed -n 's/voicex/voice'$i'/g; s/voicecolx/voicecol'$i'/g; s/" F "/" '$j' "/g;P'`"
    echo $cpath
     more $cpath 2&gt;error.log | grep " '&amp;j' " | wc -l | echo "The count of '$j' in file is: " `wc -l` 1&gt;countdir/count$j.txt
    done
  done
  </code></pre>
  
  <p>i saved this file in stest.sh. When i run the file, nothing happens. I ahve to press Ctrl+C to exit back to the command prompt.</p>
  
  <p>Let me also provide the path.cfg file: </p>
  
  <pre><code>MPAY
  /var/xacct_data/xxxx/log_flattener/xxxx/logfile_current
  
  FAFF
  /var/xacct_data/faff/faff1/log_flattener/faffsnp1/ logfile_current
  /var/xacct_data/faff/faff1/log_flattener/faffdbt1 /logfile_current
  /var/xacct_data/faff/faff1/log_flattener/fafftxn1 /logfile_current
  /var/xacct_data/faff/faff2/log_flattener/faffdbt2/ logfile_current
  
  VOICE
  /var/xacct_data/voice/voicex/log_flattener/ voicecolx/logfile_current
  /var/xacct_data/voice/voicex/log_flattener/ voiceprox/logfile_current
  /var/xacct_data/voice/voicex/log_flattener/ voicedisx/logfile_current
  
  GPRS
  /var/xacct_data/gprs/gprsx/log_flattener/gprscolx/logfile_current
  /var/xacct_data/gprs/gprsx/log_flattener/gprsprox/logfile_current
  /var/xacct_data/gprs/gprsx/log_flattener/gprsdisx/logfile_current
  
  IPC
  /var/xacct_data/ipc/ipcx/log_flattener/ipccolx/logfile_current
  /var/xacct_data/ipc/ipcx/log_flattener/ipcprox/logfile_current
  /var/xacct_data/ipc/ipcx/log_flattener/ipcdisx/logfile_current
  
  SMS
  /var/xacct_data/smsc/smscx/log_flattener/smsccolx/logfile_current
  /var/xacct_data/smsc/smscx/log_flattener/smscprox/logfile_current
  /var/xacct_data/smsc/smscx/log_flattener/smscdisx/logfile_current
  </code></pre>