Last active
August 16, 2016 09:47
-
-
Save jpbochi/25720a6779f8c98086edd53f6a8b29d1 to your computer and use it in GitHub Desktop.
bash file template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Bash3 Boilerplate. Copyright (c) 2014, kvz.io | |
# http://kvz.io/blog/2013/11/21/bash-best-practices/ | |
# https://github.com/kvz/bash3boilerplate | |
set -o errexit | |
set -o pipefail | |
set -o nounset | |
# set -o xtrace | |
# Set magic variables for current file & dir | |
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
__file="${__dir}/$(basename "${BASH_SOURCE[0]}")" | |
__base="$(basename ${__file} .sh)" | |
__root="$(cd "$(dirname "${__dir}")" && pwd)" # <-- change this as it depends on your app | |
arg1="${1:-}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment