and 命令
if [ A -a B ]
then
else
fi
while [ ]
do
done
set command
set these are parameters
$1
set
strings
str="A is a"
echo "$str"
a=30 b=15
echo `expr $a + $b`
echo `expr $a - $b`
echo `expr $a \* $b`
echo `expr $a / $b`
echo `expr $a % $b`
a=`expr $a+1`
The Internal Field Separator
IFS=:
set ":" as field separator S1:S2:...
break continue the same
function
# test function. test.sh
func()
{
echo $1
}
. test.sh
func a b 1 3
本文介绍了Shell脚本的基础语法,包括条件判断、循环结构、字符串操作、变量赋值及算术运算等内容,并展示了如何设置内部字段分隔符IFS以及如何使用break和continue控制流程。
1292

被折叠的 条评论
为什么被折叠?



