我已經寫了TCSH一個簡單的shell腳本殼.the代碼只是從用戶需要的輸入,然後運行基礎上,input.I一些已經使用開關情況下這一點,但我的問題是什麼我輸入它結束執行默認情況。Linux的TCshell腳本
#!bin/tcsh
echo "creating workdir = setup "
echo "extracting = extract"
echo "creating setups= create "
echo "validate = all(for running all validation),ve ,fa ,annotate ,Lib, CDL"
set user_input = "$<"
echo "entered string is -" $user_input
switch (user_input)
case setup:
./validateSource -sc -setup -check ve fa annotate Lib CDL -source source -library library -reference reference
breaksw
case extract:
./validateSource -sc -extract -check ve fa annotate Lib CDL -source source -library library -reference reference
breaksw
case (create):
./validateSource -sc -create -check ve fa annotate Lib CDL -source source -library library -reference reference -workdir workdir_nowb_EDA_7p2
breaksw
case (all):
./validateSource -sc -validate -check ve fa annotate Lib CDL -workdir workdir_nowb_EDA_7p2 -force
breaksw
case (ve):
./validateSource -sc -validate -check ve -workdir workdir_nowb_EDA_7p2 -force
breaksw
case (fa):
./validateSource -sc -fa -check ve -workdir workdir_nowb_EDA_7p2 -force
breaksw
case (annotate):
./validateSource -sc -validate -check annotate -workdir workdir_nowb_EDA_7p2 -force
breaksw
case (Lib):
./validateSource -sc -validate -check Lib -workdir workdir_nowb_EDA_7p2 -force
breaksw
case (CDL) :
./validateSource -sc -validate -check CDL -workdir workdir_nowb_EDA_7p2 -force
breaksw
default :
echo "wrong string entered"
endsw
'tcsh'的't'表示終端。 'tcsh'腳本沒有意義,您可以簡單地使用'csh'來使用相同的語法。 – mouviciel