title: how to write foreach in one line in csh?
body: <p>Sometimes I use same foreach operation with different target files in csh.<br>
  If I can give foreach command in a single line, I could easily substitue the target file names to repeat the process.(I usually use `find . -name ...` for target files)<br>
  For the purpose of this question, let's assume I want to cat all the *.txt files.  </p>
  
  <pre><code>$ foreach i (*.txt)
  foreach? cat $i
  foreach? end
  </code></pre>
  
  <p>I read <a href="https://unix.stackexchange.com/questions/32873/running-a-full-foreach-command">https://unix.stackexchange.com/questions/32873/running-a-full-foreach-command</a> and tried</p>
  
  <pre><code>alias disp 'echo "foreach i (*.txt)"; echo "cat "\$"i"; echo "end"; | /bin/csh'
  </code></pre>
  
  <p>when I type <code>disp</code> it gives me <code>Invalid null command</code>.<br>
  If I can do it in a single line, I could do <code>!foreach:gs/\.c\&gt;/.h/</code> (do the same replacing .c with .h).
  How can I do it?</p>