[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: which..

Argh!  What a can of worms this has opened up.  I've tested which on
several other systems and also looked at the source of the 2 examples
posted.  The problem is that they all have DIFFERENT behavior.

What do you do given two arguments, "which ls cat", for example?  Print
them both out?  Print only the first?

What do you do if nothing is found?  Print nothing?  Print something?
exit 1?

I'll just pick some reasonable behavior.  I guess there is no real
convention.  Real shells use "type".


Reply to: