bash编程语法

bash编程语法

if语句

a=10
b=20
if [[ $a > $b ]]; then echo 'big'; elif [[ $a < $b ]]; then echo "small"; elif [$a == $b]; then echo "equal";fi
small

循环

[ck153117137@shell.ceshiren.com ~]$ for i in $(cat test03.txt); do echo $i ; done 
123
124
125
126
126
127
127
127
128

while循环

循环读取文件内容并输出

[ck153117137@shell.ceshiren.com ~]$ while read i; do echo $i ;done <test03.txt 
上一篇:现代明亮人像摄影调色Lr预设


下一篇:标识符和保留字