输入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脚本练习(12.8)_shell

shell脚本练习(12.8)_比较_02