To define a function, you can use either one of two forms:
function functname{ shell commands}
or:
functname ( ) { shell commands}
You can also delete a function definition with the command unset -f functname.
You can find out what functions are defined in your login session by typing declare -f.
Learning_the_bash_Shell_Third_Edition 4/n
原文:https://www.cnblogs.com/winditsway/p/14467351.html