Bash(GNU Bourne-Again Shell)is a Unix shell and script language written by Brian Fox for the GNU Project as a free software replacement for the Bourne shell. First released in 1989, it has been used as the default login shell for most Linux distributions.
一、使用函数
1. 基本语法
1.1 声明/定义
• Single line version
function_name () { commands; }
• Multi-line version
方法1:使用小括号
function_name () {
commands
}
方法2:使用关键字function
function function_name {
commands
}
1.2 函数调用
直接使用函数名 function_name
特别地,Local variables are decl