1. #!/bin/bash
    2. #************************************************
    3. # Author: Ronnie Ming
    4. # Filename: func.sh
    5. # Date: 2021-05-02 01:44:55
    6. # Description: ...
    7. #************************************************
    8. function func1() {
    9. ...
    10. return
    11. }
    12. func2() {
    13. ...
    14. return 1
    15. }
    16. ...
    17. exit
    • #! : shebang is used to tell the kernel the name of the interpreter that should be used to execute the script that follows.
    • exit [EXIT_STATUS]
      • Terminate the script with exit status of EXIT_STATUS
      • When no argument is passed, the exit status defaults to the exit status of the last command executed.
    • When a script “runs off the end” (reaches end of file), it terminates with an exit status of the last command executed.