xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

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, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2021-10-27 11:33  xgqfrms  阅读(44)  评论(0编辑  收藏  举报