Open xgqfrms opened 3 years ago
function test () {}
#!/usr/bin/env bash
# function 定义
function test () {
echo "test function with keyword and ()"
}
test
function test {}
#!/usr/bin/env bash
# function 声明式
function test {
echo "test function with keyword"
}
test
test () {}
#!/usr/bin/env bash
# 命令式 ()
test (){
echo "test function with ()"
}
test
bash function define
bash 函数定义
bash script advanced
https://www.runoob.com/linux/linux-shell-func.html
https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Functions#%E6%9E%84%E9%80%A0%E5%87%BD%E6%95%B0_vs_%E5%87%BD%E6%95%B0%E5%A3%B0%E6%98%8E_vs_%E5%87%BD%E6%95%B0%E8%A1%A8%E8%BE%BE%E5%BC%8F