- 论坛徽章:
- 0
|
csh 代码如下:
- #!/bin/csh
- switch ( $1)
- case "1":
- step1:
- echo "step1 ---->"
- echo "$filename step1"
- echo "step1 <----"
- goto $FUNC
- step2:
- echo "step2 ---->"
- echo "$filename step2"
- echo "step2 <----"
- goto $FUNC
- breaksw
- case "2":
- set FUNC = "step3"
- cd /lib
- foreach filename ( *.so)
- goto step1
- continue
- step3:
- end
-
- foreach filename ( *.so.2)
- goto step2
- step3:
- end
- breaksw
- endsw
复制代码
现在运行该shell时报下面的错误,该如何解决?
[oleft@localhost csh]$ csh -x ./AMAJD1000.csh 2
switch ( 2 )
set FUNC = step3
cd /lib
foreach filename ( *.so )
goto step1
echo step1 ---->
step1 ---->
echo ld-2.9.so step1
ld-2.9.so step1
echo step1 <----
step1 <----
goto step3
end
end: Not in while/foreach.
[oleft@localhost csh]$csh --version
tcsh 6.15.00 (Astron) 2007-03-03 (x86_64-unknown-linux) options wide,nls,dl,al,kan,sm,rh,color,filec
[ 本帖最后由 Gdla 于 2009-8-24 21:28 编辑 ] |
|