当前位置:网站首页>shell function
shell function
2022-08-09 05:23:00 【Peanut Flavored Peanut Rice】
目录
七.Function of the variable scope
一.shell函数
将命令序列按格式写在一起,可避免重复
可方便重复使用命令序列,Divided into several small function module,代码的可读性更强
二.shell函数定义
1.函数名 (){
命令序列
}
2.function 函数名 {
命令序列
}
3.function 函数名 (){
命令序列
}
三.函数调用
1.直接写 函数中调用函数 直接写函数名
2.同名函数,后一个生效
3.调用函数一定要先定义
4.只要先定义了调用的,其他函数定义顺序无关
declare -F View the current system of all functions
declare -f View the current system of all the functions defined rules
四.判断系统类型


五.函数返回值


六. 传递参数

![]()
七.Function of the variable scope

![]()
八.函数递归


边栏推荐
猜你喜欢
随机推荐
3.3V控制输出5V的方法
C Advanced-C Language File Operation
deploy发布的jar包中文乱码
力扣202-快乐数——哈希集合
王爽 汇编语言个人疑问汇总第九篇
STM32定时器输入捕获频率(cube)
2022牛客多校联赛第七场 题解
HAL库的使用之Cube配置编码器输入捕获模式
绕过反调试fuck-debugger
【LeetCode】287. 寻找重复数
使用Redis zset做消息队列
Xray-强大的漏洞扫描工具
TP6的安装与测试
FastDFS快速使用及介绍
图解LeetCode——761. 特殊的二进制序列(难度:困难)
数字化时代,企业为什么需要商业智能BI
How to trim svg and compress
Parameters in dynamic libraries cannot be modified through macro definitions or global variables in header files
【LeetCode】1283. 使结果不超过阈值的最小除数
Oracle01-安装与卸载









