Shell脚本编程——两个数比较大小

Shell脚本编程——两个数比较大小

代码如下:

#!/bin/bash
# scriptname: ex4if.sh
#
echo -n "Please input x,y:"
read x y
echo "x=$x,y=$y"
if((x>y));then
	echo "x is larger than y"
elif((x=y));then
	echo "x is equal to y"
else
	echo "x is less than y"
fi

猜你喜欢

转载自blog.csdn.net/weixin_44145894/article/details/105176367