标签:shell 比较
输入2个数(x,y)如果x等于y,则输出z=x+y,如果x大于y,则输出z=x-y,否则输出z=x+y
vi number2.sh
#!/bin/bash
#written by lizheng
#about panduan
echo "please enter two number"
read x
read y
if test $x -eq $y
then echo "z=$x - $y"
elif test $x -gt $y
then echo "z=$x -$y"
else echo "z=$x + $y"
fi
标签:shell 比较
原文地址:http://11937277.blog.51cto.com/11927277/1880963