Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- # Adds suffix so that we can capture any trailing newlines in the directory name.
- # (Use cd -P to resolve symlinks.)
- function scriptdir {
- local suffix=$1
- local dir=$(unset CDPATH && cd "${BASH_SOURCE[0]%/*}" && echo "${PWD}$suffix")
- echo "$dir"
- }
Add Comment
Please, Sign In to add comment