Created
February 13, 2020 04:00
-
-
Save swarupdonepudi/6577c5a36b0c97e043ce5fb85fac7ba3 to your computer and use it in GitHub Desktop.
New bash programs
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 | |
set -o errexit | |
set -o nounset | |
set -o pipefail | |
# Set magic variables for current file & dir | |
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
echo "info : __dir is ${__dir}" | |
__file="${__dir}/$(basename "${BASH_SOURCE[0]}")" | |
echo "info : __file is ${__file}" | |
__base="$(basename ${__file} .sh)" | |
echo "info : __base is ${__base}" | |
#__root of the project depends on the location of this script in the folder structure | |
__root="$(cd "$(dirname "$(dirname "${__dir}")")" && pwd)" | |
echo "info : __root is ${__root}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment