Skip to content

Instantly share code, notes, and snippets.

@duraki
Created April 16, 2020 08:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save duraki/4373a53a0bd1a242e48b30411c7f7607 to your computer and use it in GitHub Desktop.
Save duraki/4373a53a0bd1a242e48b30411c7f7607 to your computer and use it in GitHub Desktop.
The first two statements of your BASH script should be…
#!/usr/bin/env bash
set -euo pipefail
@duraki
Copy link
Author

duraki commented Apr 16, 2020

#!/bin/sh 
# Author:
# License: Unlicense

set -euf

log() {
    printf '\033[32m->\033[m %s\n' "$*"
}

die() {
    log "$*" >&2
    exit 1
}

usage() {
    echo "${0##*/} ARGS
    desc
    "
    exit 0
}

Valid template for shell scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment