title: Bash: replacing a substring in pipe stdin
body: <p>I try to replace a certain substring from the stdin with a new substring. I have to get the stdin from the pipe, after reading several files by <code>cat</code>. Then I want to push the changed string forward to the pipe.</p>
  
  <p>Here is what I try to do:</p>
  
  <p><code>cat file1 file2 | echo ${#(cat)/@path_to_file/'path//to//file'} | ... | ... | ... | ...</code></p>
  
  <p>I try to replace the substring <code>@path_to_file</code> with the replacement substring <code>'path/to/file'</code> (the surrounding quotes are part of the replacement substring).</p>
  
  <p>However bash gives me an error message: <code>bad substitution</code></p>
  
  <p>Any ideas how I could accomplish this?</p>