刚刚学习shell ,做个草稿吧!
SHELL 数值比较表达
eq 等于 ge 大于等于 le 小于等于 ne 不等于 gt 大于 lt 小于
字等表达
= 等于 != 不等于
SHELL 的数值运算操作
expr number+number
$((number+number))
SHELL 的比较语句
if
if test $var
then .....
else
.....
fi
-----------------------------------
if [ ]
SHELL 的循环语句
for
for var in list
do
......
done
-------------------------------------
while
while cond
do
....
done
until
until cond
do
....
done
while 与unile 的区别,while是条件满足时执行,unile是条件不满足时执行
SHELL的分支语句
if cond1 then
....
elif cond2 then
....
elif cond3 then
....
....
else
....
fi
--------------------------------------------------------------
case
case string in
str1 | str2)
...
str3 | str4)
...;;
str5 | str6)
...;;
*)
...;;
esac
echo "usage: inetpanel [start |begin | commence |stop |end | destory| restart | again]"
-------------------------------------------------------------
select name [ in word;] do list ; done
阅读(2206) | 评论(0) | 转发(0) |