Skip to content

Latest commit

 

History

History

use-a-main-function

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Use a main() function

Wrap all the code in a main() function that gets called at the bottom of the file, so that a truncated partial download doesn't accidentally end up executing half a script.

Example:

#!/bin/sh
set -eu

main() {
    …
}

main