首页 > 系统服务 > 详细

shell--基本语法

时间:2021-08-19 14:41:12      阅读:21      评论:0      收藏:0      [点我收藏+]
  1. 分支
if cond;then
  commands
fi

if cond;then
  commands1
else
  commands2
fi

if cond1;then
  commands1
elif cond2;then
  commands2
else
  commands3
fi

case value in
  case1)
    commands1
  case2)
    commands2
esac
  1. 循环
while cond;do
  commands
done

util cond;do
  commands
done

for var in list;do
  commands
done
  1. 函数
[ function ] funname [()]
{
  commands;
  [return int]
}
  1. 模块引用
. /path/module.sh
source /path/module.sh

shell--基本语法

原文:https://www.cnblogs.com/ai-tech/p/15160679.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!