利用 set 来取得变数, set ABC = "I am ABC"
也可以利用 `command` 来取得命令
且外,case 也可以用万用字元 * 来代替
set VER = `uname -r`
switch ($VER)
case 5.5:
echo "run the setup of $VER"
breaksw
case 5.3:
echo "run the setup of $VER"
breaksw
case 5.*:
echo "like 5.x"
breaksw
case 4.*:
echo "like 4.x"
breaksw
default:
echo "no idea"
endsw
也可以利用 `command` 来取得命令
且外,case 也可以用万用字元 * 来代替
set VER = `uname -r`
switch ($VER)
case 5.5:
echo "run the setup of $VER"
breaksw
case 5.3:
echo "run the setup of $VER"
breaksw
case 5.*:
echo "like 5.x"
breaksw
case 4.*:
echo "like 4.x"
breaksw
default:
echo "no idea"
endsw