12/04/2009

shell script 数字变量输出命令 declare

declare -i c
a=3
b=5
c=$a*$b
echo $c
如果没有declare 指令,则该变量c则默认为字符串,
输出为
3*5
如果有这个指令
则输出为
15

没有评论: