标签:test 2016年 ash result bash not 数字 实现 shel
#!/bin/bash #This is a test of the addition of the program! function AddFun { read -p "Enter a number:" num1 read -p "Enter another number:" num2 echo $[ $num1 + $num2 ] } result=`AddFun` echo "The Result is :$result"
上面这段代码主要实现的功能是建立一个函数,通过控制台输入2个数字后,求这两个数字之后并输出结果。这个程序并不是很难,但是新手刚写,真的未必写得出来的。房子啊这里,只是一个点滴积累,在忘记语法的时候可以有个查看的依据----2016年11月的第一天
标签:test 2016年 ash result bash not 数字 实现 shel
原文地址:http://www.cnblogs.com/OliverQin/p/6020223.html