Shell/Bash: how to get a script's directory in bash Example

By

Shell/Bash Example: This is the "how to get a script's directory in bash" Example. compiled from many sources on the internet by SimpleTutorials.org

how to get a script's directory in bash

#!/bin/bash

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"



* Summary: This "how to get a script's directory in bash" Shell/Bash Example is compiled from the internet. If you have any questions, please leave a comment. Thank you!

Others