bash advanced 之 bash function define All In One

bash advanced 之 bash function define All In One

bash function define / bash 函数定义

  1. function test () {}
#!/usr/bin/env bash

# function 定义
function test () {
  echo "test function with keyword and ()"
}
test

  1. function test {}
#!/usr/bin/env bash

# function 声明式
function test {
  echo "test function with keyword"
}
test

  1. test () {}
#!/usr/bin/env bash

# 命令式 ()
test (){
  echo "test function with ()"
}
test

image

refs

https://github.com/xgqfrms/bash-all-in-one/issues/3#issuecomment-952500845



©xgqfrms 2012-2020

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 ️,侵权必究⚠️!


xgqfrms
原文地址:https://www.cnblogs.com/xgqfrms/p/15469813.html