shell scripts 中declare 声明变量的问题?
发表于 : 2008-06-04 21:17
刚学shell scripts。
脚本:
declare -i s=0
5 for(( i=1 ;i<=100;i=i+1))
6 do
7 s=s+1;
8 done
9 echo "the count is ==> $s "
10
~
执行之后提示:
test11.sh: 4: declare: not found
test11.sh: 5: Syntax error: Bad for loop variable
脚本:
declare -i s=0
5 for(( i=1 ;i<=100;i=i+1))
6 do
7 s=s+1;
8 done
9 echo "the count is ==> $s "
10
~
执行之后提示:
test11.sh: 4: declare: not found
test11.sh: 5: Syntax error: Bad for loop variable