码迷,mamicode.com
首页 > 系统相关 > 详细

liunx shell数字相加

时间:2014-10-14 04:47:17      阅读:405      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   sp   div   log   bs   as   class   

#!/bin/bash

num1=1
num2=2
num3=3


#echo $($num1+$num2+$num3)#错误写法
echo $[$num1+$num2+$num3]
echo $(($num1+$num2+$num3))
echo $(expr $num1 + $num2 + $num3 )

 

liunx shell数字相加

标签:style   blog   color   sp   div   log   bs   as   class   

原文地址:http://www.cnblogs.com/ghgyj/p/4023500.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!