1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
# Example of parameter lists and argument type checking. greet(bool doprint, int i, string s) { if ${doprint}; then while [ ${i} -gt 0 ]; do printf '%s\n' "${s}" i=$((${i} - 1)) done fi } main() { greet true 3 'Hello, world!' return 0 }