02.shell创建函数并调用
2019-11-29 本文已影响0人
吕小凯
shell声明函数很简单
function 函数名(){
函数体
}
例如如下shell脚本
#!/bin/bash
#声明函数
function hello(){
echo 'hello,shell'
}
#调用函数
hello
shell声明函数很简单
function 函数名(){
函数体
}
例如如下shell脚本
#!/bin/bash
#声明函数
function hello(){
echo 'hello,shell'
}
#调用函数
hello