Guest User

Untitled

a guest
Jan 20th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # When sourced from .bash_profile, "$0" is "-bash". If we are NOT being
  4. # sourced, print out this file's directory.
  5. if [ "$0" != "-$(basename -- "$SHELL")" ]; then
  6. cd "$(dirname "$0")";
  7. pwd;
  8. exit;
  9. fi;
  10. echo "This is me being sourced, aight? This is the directory: $dir";
  11.  
  12. # Save this file as ~/bin/tets.sh and add this to ~/.bash_profile:
  13. # dir="$(~/bin/tets.sh)";
  14. # source ~/bin/tets.sh;
Add Comment
Please, Sign In to add comment