求教:一个c shell脚本文件的问题

求教:一个c shell脚本文件的问题

我在执行下面的脚本文件时返回setenv:too many arguments
我应该怎样正确操作?(详细一点)
若改称bash的脚本文件应该改哪几处?
多谢!!
#! /bin/csh
clear
#
# =================================================================
# ====
# ---- default directory for MM5-MICAPS system is ~/MODEL ====
# ---- you can change it if you like ! ====
# ====
# ---- In which directory do you want to install the system? ====
# ====
set path_mm5=~/MODEL_MICAPS
#
# ---- set the path of mm5 programs in CDROM ====
# ====
# set path_cdrom=/mnt/cdrom/MM5_v3.4
# set path_cdrom=/home/gao/MODEL/mm5v3.5
set path_cdrom=./MM5v3.5
# ====
# ========== End of Users Modifications ==========================
#
#
# Do not touch anything below! Dangerous!
#
#
echo ' ============================================================'
echo ' ==== ===='
echo ' ==== Welcome to use MM5-MICAPS ===='
echo ' ==== ===='
echo ' ==== Install MM5-MICAPS system for you now. ===='
echo ' ==== ===='
echo ' ==== MM5 Version is V3 now. ===='
echo ' ==== ===='
echo ' ==== GAO Shanhong, 31 July 2001, Qingdao. ===='
echo ' ==== ===='
echo ' ============================================================'
date
echo ' '
#
# --- check tpying
#
set no=' '

if( ($1 != $no) && ($1 != 'f') ) then
echo ' Typing is wrong, you can only type:'
echo ' install_mm5 or install_mm5 f '
echo ' '
exit
endif
#
# ---- make the Structure of MM5-MICAPS System below.
#
if( -e $path_cdrom ) then
else
echo ' No disk in the CD driver!'
echo ' Or the path_cdrom='$path_cdrom' is wrong !'
echo ' '
echo ' Please check it !'
echo ' '
exit
endif

# --- echo infornation
#
echo ' MM5-MICAPS system will be installed in '$path_mm5
echo ' The MM5 source code comes from '$path_cdrom
echo ' '


if( -e $path_mm5 ) then
echo ' There is already '$path_mm5'!'
echo ' You had better change path_mm5.'
echo ' If you want to cover the old files forcely,'
echo " please type 'install_mm5 f'!"
echo ' '
if( $1 == $no ) then
exit
endif
if( $1 == 'f' ) then
echo ' But you do not want to change, thus'
echo ' cover the old files of '$path_mm5'!'
echo ' '
endif
else
mkdir $path_mm5
mkdir $path_mm5/PRE
mkdir $path_mm5/INPUT
endif
#
# ---- Copy preprocessor programs into ~/PRE/
#
echo ' copying preprocessor programs: terrain,regrid,little_r,interpf,rip '
cp $path_cdrom/TERRAIN.TAR.gz $path_mm5/PRE
cp $path_cdrom/REGRID.TAR.gz $path_mm5/PRE
cp $path_cdrom/LITTLE_R.TAR.gz $path_mm5/PRE
cp $path_cdrom/INTERPF.TAR.gz $path_mm5/PRE
cp $path_cdrom/RIP.TAR.gz $path_mm5/PRE
#
# ---- Copy main program mm5 into $path_mm5/MM5
#
echo ' copying main program: mm5 '
cp $path_cdrom/MM5.TAR.gz $path_mm5/
#
# ---- uncompress the programs
#
echo ' '
echo ' uncompressing the copied files '
echo ' mm5_tar.gz'
cd $path_mm5/
gunzip $path_mm5/MM5.TAR.gz
tar -xvf $path_mm5/MM5.TAR > out
rm -rf $path_mm5/MM5.TAR out
#
cd $path_mm5/PRE
echo ' terrain_tar.gz '
gunzip $path_mm5/PRE/TERRAIN.TAR.gz
tar -xvf $path_mm5/PRE/TERRAIN.TAR > out
rm -rf $path_mm5/PRE/TERRAIN.TAR out
#
echo ' regrid_tar.gz '
gunzip $path_mm5/PRE/REGRID.TAR.gz
tar -xvf $path_mm5/PRE/REGRID.TAR > out
rm -rf $path_mm5/PRE/REGRID.TAR out
#
echo ' little_r_tar.gz '
gunzip $path_mm5/PRE/LITTLE_R.TAR.gz
tar -xvf $path_mm5/PRE/LITTLE_R.TAR > out
rm -rf $path_mm5/PRE/LITTLE_R.TAR out
#
echo ' interpf_tar.gz '
gunzip $path_mm5/PRE/INTERPF.TAR.gz
tar -xvf $path_mm5/PRE/INTERPF.TAR > out
rm -rf $path_mm5/PRE/INTERPF.TAR out
#
echo ' rip_tar.gz '
gunzip $path_mm5/PRE/RIP.TAR.gz
tar -xvf $path_mm5/PRE/RIP.TAR > out
rm -rf $path_mm5/PRE/RIP.TAR out
#
echo ' finish uncompressing process '
#
# ---- make a link : regrid <----> REGRID/regridder
#
ln -s REGRID/regridder regrid
#
echo ' '
echo ' OK !'
echo ' '
#
# ====================== END of the file ==========================      
把你的问题抽象概括一下,没人喜欢看这么冗长的 code      
1.如何用bash中的语言表示-e $path_cdrom的意思?
2.如何运行c_shell脚本?
3.set path_mm5=~/MODEL_MICAPS在cshell中语法对吗?      
1. 不懂你的意思
2. ./foo.csh
3. 试一试了      
2.能不能说详细一点?我执行./foo.csh返回commend not found,执行./install_mm5(文件名)返回
setenv:too many arguments

make 命令是怎么回事?      
???
!!!      
新手不是懒惰的理由      
因为本来我只要运行一下cshell脚本程序完成安装后就可以进行下一步工作了,但是在其他机子上可以运行的cshell程序在我的机子上不能正常运行总是返回setenv:too many arguments原因找不到,只好看一下脚本程序,但是我手头的关于cshell的资料并不多,时间压得紧,我也不可能太系统的学只好请教你们,问题可能幼稚点,但你可以给我推荐一些材料我自己看也可,说我懒惰我很伤心...      
写个脚本单独试一下 setenv, 看看有什么现象      
复制内容到剪贴板
代码:
[color=red]setenv [name [value]][/color]
    Without arguments, prints the names and values of all
environment variables.  Given name, sets the environment
variable name to value or, without value, to the null
string.