-
-
Save rickhull/cead1daa0ec979bad29a to your computer and use it in GitHub Desktop.
containing dir, in bash
This file contains 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
rwh@UbuntuVM:~/git$ ../test.bash | |
PWD=/home/rwh/git | |
DIR=/home/rwh | |
dirname=.. |
This file contains 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 | |
echo PWD=$PWD | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
echo DIR=$DIR | |
echo dirname=`dirname $0` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment