Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # When sourced from .bash_profile, "$0" is "-bash". If we are NOT being
- # sourced, print out this file's directory.
- if [ "$0" != "-$(basename -- "$SHELL")" ]; then
- cd "$(dirname "$0")";
- pwd;
- exit;
- fi;
- echo "This is me being sourced, aight? This is the directory: $dir";
- # Save this file as ~/bin/tets.sh and add this to ~/.bash_profile:
- # dir="$(~/bin/tets.sh)";
- # source ~/bin/tets.sh;
Add Comment
Please, Sign In to add comment