Skip to content

Instantly share code, notes, and snippets.

@pcewing
Created June 18, 2020 17:55
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 pcewing/1ea5a2c02cf5db1712ac40aecc04606b to your computer and use it in GitHub Desktop.
Save pcewing/1ea5a2c02cf5db1712ac40aecc04606b to your computer and use it in GitHub Desktop.
Bash script base, useful common utilities for shell scripting
#!/usr/bin/env bash
function yell () { >&2 echo "$*"; }
function die () { yell "$*"; exit 1; }
function try () { "$@" || die "Command failed: $*"; }
script_path="$( realpath "$0" )"
script_dir="$( dirname "$script_path" )"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment