tj / commander

The complete solution for Ruby command-line executables
http://visionmedia.github.com/commander
MIT License
1.09k stars 64 forks source link

The `find` statement fails on Windows #69

Closed kodybrown closed 9 years ago

kodybrown commented 10 years ago

The following statement fails; user_interaction.rb line #240:

find {|name| system("hash #{name.split.first} 2>&-") }

I changed it to this, which now works:

find {|name| system("hash #{name.split.first} 2>&1") }

But, now I don't know where to find hash.. Is this a bash util or built-in lib somewhere? I tried gem install hash but it does not seem to be what it is looking for..

I'm running bro (on Windows) which uses commander..

ggilder commented 10 years ago

hash is a shell builtin that shows you the cached hash table of available commands.

It looks like a change to &1 would be ok here since we're not using the output of hash. Normally &- is used to close a file descriptor, see http://www.tldp.org/LDP/abs/html/io-redirection.html

Does that change solve the issue for you, or is there still some issue with hash?

If it solves it feel free to put together a pull request. Thanks!

ggilder commented 9 years ago

This issue was moved to commander-rb/commander#4