1.整理思维导图
2.终端输入两个数,判断两数是否相等,如果不相等,判断大小关系
#!/bin/bash
read num1
read num2
if [ $num1 -eq $num2 ]
then
echo num1=num2
elif [ $num1 -gt $num2 ]
then
echo "num1>num2"
else
echo "num1<num2"
fi
3.已知网址www.hqyj.com,使用expr截取出www、hqyj、com,不能使用cut,不能出现数字
#!/bin/bash
str=www.hqyj.com
len1=`expr length $str`
pos1=`expr index $str .`
echo `expr substr $str 1 $((pos1-1))`
len2=`expr substr $str $[pos1+1] $len1`
pos2=`expr index $len2 .`
echo `expr substr $len2 1 $((pos2-1))`
len3=`expr length $len2`
echo `expr substr $len2 $((pos2+1)) $len3`
4.预习test指令的man手册