I am trying to run the following script which will start a simulation run with a climate simulation program:
#!/bin/csh
# run-script generated by Most Tue Jul 23 13:10:46 2013
set EXP=MOST # Name your experiment here
unset noclobber
if ($1 != "") cd $1
# rm -f plasim_restart
cp MOST_REST.010 plasim_restart
rm -f Abort_Message
set YEAR = 10
set YEARS = 50
while ($YEAR < $YEARS)
set YEAR = `expr $YEAR + 1`
set DATANAME=`printf '%s.%03d' $EXP $YEAR`
set DIAGNAME=`printf '%s_DIAG.%03d' $EXP $YEAR`
set RESTNAME=`printf '%s_REST.%03d' $EXP $YEAR`
./most_plasim_t42_l10_p1.x >${DIAGNAME}
if (-e Abort_Message) exit 1
if (-e puma_output) mv puma_output $DATANAME
if (-e puma_diag ) mv puma_diag $DIAGNAME
cp plasim_status plasim_restart
mv plasim_status $RESTNAME
end
When I try to run it, I get the following error message:
./most_plasim_run: line 1: ?#!/bin/csh: No such file or directory
./most_plasim_run: line 5: syntax error near unexpected token `cd'
./most_plasim_run: line 5: `if ($1 != "") cd $1'
I am mystified by this error message because I do in fact have bin/csh. I don't know where the problem is.
#! /bin/bash
line 1: ?#!/bin/csh
– did you perhaps save this file with a byte-orden mark (BOM)?