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
#!/bin/bash | |
# Go to the location where your script located wherever your run it, | |
# and store the path contains the script at DIR. | |
# ${BASH_SOURCE[0]} is a more precised way to locate compare to $0 | |
# https://stackoverflow.com/questions/35006457/choosing-between-0-and-bash-source | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | |
# Set DIR as the working directory. |