编写shell脚本
刚学的记录一下if语句
#!/bin/bash #声明此shell脚本的名字
#Program:
#This is a program shows "Hello world" in your screen.
#History:
#2022-4-13 nn First Release
PATH=/root:$PATH
export PATH #让PATH变成全局变量
echo -e "Hello World! \a \n" #输出Hello World!信息 -e是发出警报声
read -p"input num1:" num1 #读取键盘上输入的字且保存为变量num1 "input num1:"是提示信息
read -p"input num2:" num2
read -p"input num3:" num3
max=$num1
if ((num2>max)) #if语句 输入3个数且找出最大值
then
max=$num2
fi #结束if语句
if ((num3>max))
then
max=$num3
fi
echo "max=$max"
exit 0 #返回参数0