if
比较两个变量的大小并输出不同的值
i f [ $a -eq $b ]; then echo “equal”; elif [ $a -lt $b ];then echo “small”; elif [ $a -gt $b ];then echo “big”;fi
for
循环读取文件内容并输出
for i in $(cat dir.txt);do echo $i;done
while
循环读取文件内容并输出
while read line;do echo $line;done<dir.txt