Hi Roman,

The type command is the preferred way to do this. I don't think your example is 
ugly (maybe I have lower standards though!)

Note that in top of tree, type has a --quiet option, so you will be able to 
write `type command --quiet`

Hope that helps,
_fish

On Sep 6, 2014, at 1:21 AM, Roman Inflianskas <infr...@gmail.com> wrote:

> I want to execute a command but I'm not sure that it exists. I know how to 
> check function existence. But how can I check command existence? I didn't 
> find an option for `test` to do this. The only way I found is:
> 
> type COMMAND >/dev/null; and COMMAND $argv
> 
> But it's kind of ugly.
> 
> -- 
> Regards, Roman Inflianskas


------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to