Skip to content

Instantly share code, notes, and snippets.

@mpapis
Created June 3, 2011 08:08
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 mpapis/1006039 to your computer and use it in GitHub Desktop.
Save mpapis/1006039 to your computer and use it in GitHub Desktop.
Issues with `command -v` on opensuse
mpapis@niczsoft:~/projects/opensource> test_f(){
> echo 'a'
> }
mpapis@niczsoft:~/projects/opensource> test_f
a
mpapis@niczsoft:~/projects/opensource> which test_f
which: no test_f in (/home/mpapis/.rvm/gems/ruby-1.9.2-p180/bin:/home/mpapis/.rvm/gems/ruby-1.9.2-p180@global/bin:/home/mpapis/.rvm/rubies/ruby-1.9.2-p180/bin:/home/mpapis/.rvm/bin:/usr/local/bdsm/pkg/active/bin:/home/mpapis/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/sbin:/usr/sbin)
mpapis@niczsoft:~/projects/opensource> type test_f | head -1
test_f is a function
mpapis@niczsoft:~/projects/opensource> command -v test_f ; echo $?
test_f
0
mpapis@niczsoft:~/projects/opensource> (unset test_f; command -v test_f) ; echo $?
1
mpapis@niczsoft:~/projects/opensource/bdsm2> command -v rvm ; echo $?
rvm
0
mpapis@niczsoft:~/projects/opensource/bdsm2> (unset rvm ; command -v rvm) ; echo $?
/home/mpapis/.rvm/bin/rvm
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment