bash.shell summary

#nano filename.sh
create a file .sh end. It indicates that the script file
# / bin / bash!
Indication bash be interpreted
if the judgment condition; the then
echo. "Yes"
the else
echo. "NO"
fi
bash -x step execution [capabilities for easy viewing in the end is wrong]
bash -n test whether syntax error
multibranched if statements
if the condition is determined; then
performed
elif determination condition; then
performed
elif determination condition; then
executed
else
perform
fi

        if    如果          then   然后,那么        elif   否则;如果       else    其他的,如果。否则             fi 完结

        如果存在           就                    否则
                                    &&                   ||
        如果不存在        就                      否则
         !                     &&                       ||
         如果不存在          就           并且                否则
         !                         &&             &&                ||
         !是取反的意思

         &>/dev/null      垃圾桶{不用显示的放这里}

位置变量;$1;$2;$3.........表示
特殊变量;$?
$#
$*
$@

Guess you like

Origin blog.51cto.com/14531315/2440370
Recommended