Using 2>&1 | tee $fout.login csh

I created this bash script. However when I tried to do it using csh, 2>&1 | tee $fout.log did not work.

#!/bin/bash

  data=$1
  inmod=$2
  nxz=$3

  data=` echo $data | awk 'BEGIN { FS=".dat" } { print $1 }' `
  inmod=` echo $inmod | awk 'BEGIN { FS=".vmod" } { print $1 }' `
  nx=` echo $nxz | awk 'BEGIN { FS="x" } { print $1 }' `
  nz=` echo $nxz | awk 'BEGIN { FS="x" } { print $2 }' `
  fout="${data}-${nx}x${nz}-drw"

/nethome/chrisd/Zollo/Chrisd/Tommy-0911/bin/tdarwin base=sunsp.base  \
    data=$data.dat param="P" intp="LIN" inmod=$inmod.vmod            \
    nlay=1 std=on nxp=$nx nzp=$nz npop=60 dtau=0.15 mdacc=0.1        \
    varp=1.0 sigma0=100.0 maxiter=200 maxitertp=10 tol=0.0           \
    outmod=$fout.vmod backup=$fout.bck expl=$fout.exp                \
    vrb=high 2>&1 | tee $fout.log

Hello,

here's the bad news: you can't do that in csh. See for instance Csh Programming Considered Harmful. The relevant excerpt:

Cheers,
Lo�c

I have used

|& tee $fout.log

Seems to work. What does everybody think of this?

Yeah, in your case that should work. I concentrate on the 2>&1, but you're doing more than that: you then pipe to tee. AFAICS, this action is equivalent to |&

Cheers,
Lo�c.