Created
December 12, 2018 16:45
-
-
Save nohillside/b1eb0d5b0718b77384fb0daefc04dbff to your computer and use it in GitHub Desktop.
Tilde expansion for PATH in bash
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
pse@Mithos:~$ echo $PATH | |
/Users/pse/.bin/script:/Users/pse/.bin/i386:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/go/bin:/usr/local/MacGPG2/bin:/usr/local/mysql/bin:/opt/X11/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands | |
pse@Mithos:~$ PATH="~/.tmp:$PATH" | |
pse@Mithos:~$ echo $PATH | |
~/.tmp:/Users/pse/.bin/script:/Users/pse/.bin/i386:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/go/bin:/usr/local/MacGPG2/bin:/usr/local/mysql/bin:/opt/X11/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands | |
pse@Mithos:~$ cat >.tmp/foo | |
#!/bin/bash | |
echo hello world | |
pse@Mithos:~$ chmod +x .tmp/foo | |
pse@Mithos:~$ type foo | |
foo is /Users/pse/.tmp/foo | |
pse@Mithos:~$ foo | |
hello world | |
pse@Mithos:~$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment