Created
October 22, 2014 04:59
-
-
Save chaimleib/d23264893dd115b94a4b to your computer and use it in GitHub Desktop.
Converts path to an absolute path. If no path given, gives current directory.
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 | |
## Syntax: | |
## abspath [path] | |
# Converts path to an absolute path. If no path given, gives current directory. | |
function abspath() { | |
[[ -n "$1" ]] && pushd "$1" >/dev/null | |
pwd | |
[[ -n "$1" ]] && popd >/dev/null | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment