In Shell programming , we should use $(( )) if we want to do arithmetic operation.

for example :

 

a=10

$((b=$a+10))

echo $b

$((c=$a*10))

echo $c

 

then we can get b=20 and c=100.

 

 

文章標籤
全站熱搜
創作者介紹
創作者 JerryCheng 的頭像
JerryCheng

KwCheng's blog

JerryCheng 發表在 痞客邦 留言(0) 人氣(6)