Skip to content

Instantly share code, notes, and snippets.

@dualbus
Created May 25, 2014 19:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dualbus/96dc83c9d8d306da42eb to your computer and use it in GitHub Desktop.
Save dualbus/96dc83c9d8d306da42eb to your computer and use it in GitHub Desktop.
zsh:
+zsh:4> command -v xyz
xyz
+zsh:5> unset xyz
+zsh:6> command -v xyz
xyz
+zsh:8> PATH=''
+zsh:9> command -v xyz
xyz
+zsh:10> PATH=:
+zsh:11> command -v xyz
xyz
+zsh:12> PATH=.
+zsh:13> command -v xyz
xyz
+zsh:14> PATH=../t
+zsh:15> command -v xyz
xyz
ksh:
+ command -v xyz
xyz
+ unset xyz
+ command -v xyz
xyz
+ PATH=''
+ command -v xyz
xyz
+ PATH=:
+ command -v xyz
xyz
+ PATH=.
+ command -v xyz
xyz
+ PATH=../t
+ command -v xyz
xyz
mksh:
+ command -v xyz
xyz
+ unset xyz
+ command -v xyz
xyz
+ PATH=
+ command -v xyz
xyz
+ PATH=:
+ command -v xyz
xyz
+ PATH=.
+ command -v xyz
xyz
+ PATH=../t
+ command -v xyz
xyz
dash:
+ command -v xyz
xyz
+ unset xyz
+ command -v xyz
xyz
+ PATH=
+ command -v xyz
xyz
+ PATH=:
+ command -v xyz
xyz
+ PATH=.
+ command -v xyz
xyz
+ PATH=../t
+ command -v xyz
xyz
bash:
+ command -v xyz
xyz
+ unset xyz
+ command -v xyz
+ PATH=
+ command -v xyz
/home/dualbus/t/xyz
+ PATH=:
+ command -v xyz
./xyz
+ PATH=.
+ command -v xyz
./xyz
+ PATH=../t
+ command -v xyz
../t/xyz
/bin/bash:
+ command -v xyz
xyz
+ unset xyz
+ command -v xyz
+ PATH=
+ command -v xyz
/home/dualbus/t/xyz
+ PATH=:
+ command -v xyz
./xyz
+ PATH=.
+ command -v xyz
./xyz
+ PATH=../t
+ command -v xyz
../t/xyz
busybox sh:
+ command -v xyz
xyz
+ unset xyz
+ command -v xyz
+ PATH=
+ command -v xyz
xyz
+ PATH=:
+ command -v xyz
xyz
+ PATH=.
+ command -v xyz
./xyz
+ PATH=../t
+ command -v xyz
../t/xyz
#!/bin/bash
for shell in zsh ksh mksh dash bash /bin/bash 'busybox sh'; do
echo "$shell":
$shell <<eof
set -x
xyz(){ :; }
command -v xyz
unset xyz
command -v xyz
PATH=
command -v xyz
PATH=:
command -v xyz
PATH=.
command -v xyz
PATH=../t
command -v xyz
eof
echo
done
echo xyz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment