#shell  if的语法

if [空格 xxx  空格]
  then
  echo xxxxx
  exit  1/2/3/4/....   0表示正确。
elif [空格 xxx 空格]
  then
  echo xxxx
else
  echo xxxx
fi

 

shell  if,case,for,while语法

 

#CASE  语法。
case "$xx" in
  "xx0")
  echo "xxx"
  ;;
  "xx1")
  echo "xxx111"
  ;;
  *)
  echo "这里相当于else"
esac

 

shell  if,case,for,while语法

//写一个 if和for 都存在的。看代码和结果

shell  if,case,for,while语法   shell  if,case,for,while语法

 

#while循环  语法
while [条件判断]
do
#程序执行。。。
done 

shell  if,case,for,while语法

 

相关文章:

  • 2021-11-25
  • 2021-08-17
  • 2022-12-23
  • 2021-06-26
  • 2021-12-17
  • 2021-11-10
  • 2021-11-25
猜你喜欢
  • 2022-12-23
  • 2021-09-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-08
  • 2022-12-23
相关资源
相似解决方案