Guest User

Untitled

a guest
Feb 16th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. # Adds suffix so that we can capture any trailing newlines in the directory name.
  4. # (Use cd -P to resolve symlinks.)
  5.  
  6. function scriptdir {
  7. local suffix=$1
  8. local dir=$(unset CDPATH && cd "${BASH_SOURCE[0]%/*}" && echo "${PWD}$suffix")
  9. echo "$dir"
  10. }
Add Comment
Please, Sign In to add comment