标签:result log echo [] 脚本 ... div res bash
直接上代码。
#!/bin/bash no1=4 no2=5 echo "using let ..." let result=no1+no2 echo "result is: ${result}" let result++ echo "result after 1 increment is: ${result}" let result+=6 echo "result after 6 increment is: ${result}" echo "using []..." result=$[ no1 + no2 ] echo "result is: ${result}" echo "using (())..." result=$(( no1 + no2 + 1 )) echo "result is: ${result}" echo "using expr ..." result=$( expr $no1 + $no2 + 2 ) echo "result is: ${result}" echo "using \`\` ..." result=`expr $no1 + $no2 + 3` echo "result is: ${result}"
标签:result log echo [] 脚本 ... div res bash
原文地址:http://www.cnblogs.com/gattaca/p/7222925.html