title: string manipulation not working in tcsh - don't understand variables of subprograms
body: <p>first of all my code:</p>
  
  <pre><code>#!/bin/tcsh
  #linebroadening, zero filling, Fouriertransform, Phase Correction, automatic baseline corr.,output
  xyz2pipe -in fid/test%03d.fid -x -verb                \
  | nmrPipe -fn EM -lb 20.0                             \
  | nmrPipe  -fn ZF -auto                               \
  | nmrPipe -fn FT -auto                                \
  | nmrPipe -fn PS -p0 90.0 -p1 0.0 -di                 \
  | nmrPipe  -fn POLY -auto                             \
  | pipe2xyz -out ft2_01/test%03d.ft2 -ov -verb
  \
  #ROIs:
  xyz2pipe -in ft2_01/test%03d.ft2 -x -verb             \
  | nmrPipe  -fn EXT -x1 -109ppm -xn -120ppm -sw        \
  | pipe2xyz -out ft2_roi/test%03d.ft2 -ov -verb
  \
  mkdir -p ft2_sum
  mkdir -p ft2_sum_txt
  proj2D.tcl -in ft2_roi/test001.ft2 -sum -out ft2_sum/test001
  pipe2txt.tcl ft2_sum/test001/1H.dat &gt; ft2_sum_txt/test001.txt
  </code></pre>
  
  <p>Short description of code until code line no. 17:
  processing of raw 3D data which is saved into planes of 2D data as .ft2 files. Their file names are like that:
  test001.ft2
  test002.ft2
  .
  .
  .
  now I wanted to iterate with two different scripts over those files. Above is an working example how it works for a single file. Unfortunately I dont understand how this notation <code>%03d</code> works inside xyz2pipe. Is there a way to access this iteration method directly with the scripts proj2D.tcl and pipe2txt.tcl (maybe via shell pipes)?
  So alternatively I tried to manipulate the filenames myself to iterate over all relevant files:</p>
  
  <pre><code>foreach file (ft2_roi/*)
    echo $file
    echo $file/ft2_roi
    echo ${file%.ft2}
    echo ${file#ft2_roi/}
  end
  </code></pre>
  
  <p>which gives following output:</p>
  
  <pre><code>ft2_roi/test001.ft2
  ft2_roi/test001.ft2/ft2_roi
  Missing '}'.
  </code></pre>
  
  <p>So the <code>echo ${file%.ft2}</code> and <code>echo ${file#ft2_roi/}</code> string manipulation don't work correctly. What am I doing wrong?
  Thanks for any advice or help!
  best wishes,
  Hannes</p>