Created
November 19, 2013 16:39
-
-
Save mattieb/7548324 to your computer and use it in GitHub Desktop.
bashing 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
megaweapon:tmp matt$ mkdir -p foo/baz | |
megaweapon:tmp matt$ cd foo | |
megaweapon:foo matt$ PATH=/tmp/foo/baz:/tmp/foo:$PATH | |
megaweapon:foo matt$ cat >bar | |
#!/bin/sh | |
echo "this isn't the bar you're looking for" | |
megaweapon:foo matt$ chmod +x bar | |
megaweapon:foo matt$ bar | |
this isn't the bar you're looking for | |
megaweapon:foo matt$ cat >baz/bar | |
#!/bin/sh | |
echo "this IS the bar you're looking for" | |
megaweapon:foo matt$ chmod +x baz/bar | |
megaweapon:foo matt$ bar | |
this isn't the bar you're looking for | |
megaweapon:foo matt$ which bar | |
/tmp/foo/baz/bar | |
megaweapon:foo matt$ hash -r | |
megaweapon:foo matt$ bar | |
this IS the bar you're looking for |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment