Skip to content

Instantly share code, notes, and snippets.

View huonw's full-sized avatar

Huon Wilson huonw

View GitHub Profile
@huonw
huonw / bash-tutorial.sh
Last active September 28, 2020 01:57
Bash Tutorial
#!/bin/bash
# (The directive above is called a "shebang": https://en.wikipedia.org/wiki/Shebang_(Unix) )
# Helper function that prints each of the arguments (functions can be
# declared with `function <name> { ... }` or `<name>() { ... })
printArguments() {
# arguments come in as the variables $1, $2, $3, ...
count=1
# (( ... )) does numeric tasks
while (( $# )); do