shell
#! /bin/bash 头文件
echo -e 若字符串出现特殊字符,则特别处理
     -n 不要在最后自动换行
    ./filename.sh sh filename.sh
read -p  输入   read 变量1  变量2
     提示语
整数运算方法
    $(())  $[]
    declare -i
    expr
    let a=b+c
    test -e file #[-e file]  && echo"yes" || "no"
字符串判断
    -z 字符串  判断字符串是否为空
    test -f                -d         -r        -w         -x
        是否为普通文件     是否为目录    是否可读   是否可写    是否可操作
if [ 条件表达式 ]; then
if [ 条件 ]; then
elif[ 条件 ];then
else
fi
 
case $变量名   in  “第一个变量内容” )
    echo""
    ;;
$1 $2 传递参数的位置
$0 当前路径
while [ condition ]
do
    程序段落
done
 
until []
do
    程序段落
done
 
for((初始值;限制值;执行步长))
do
    程序段落
done
posted on 2021-01-11 18:10  VincentAdamNemessis  阅读(66)  评论(0编辑  收藏  举报