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

Re: Bug#478850: posh: $ENV variable processed by non-interactive shells



On Thu, 1 May 2008 14:47:54 +0100, Clint Adams <schizo@debian.org> said: 

> On Thu, May 01, 2008 at 02:33:04PM +0100, Stephane Chazelas wrote:
>> I don't really care about the "interactive" side of things ($ENV,
>> $PSx, job control), but I tend to consider that for the scripting
>> side of things, the optional features should be implemented. For
>> instance, if you don't have command -v, there's no other reliable way
>> to find out whether a command exists or not. So you have to have
>> something (either "command -v" or "type").

> If policy wants to mandate either "command -v" or "type", we could
> conceivably move toward dropping "which" from debianutils.

        Well, type does not have a uniform implementation right now. And
 very few as as scripting friendly as which (most require you to remove
 junk from the output). Command -v also has mi9xed success.

,----[ Canonical which output ]
| __> /bin/which which
| /bin/which
`----

,----[ Bash, which is just plain wrong ]
| __> bash
| % type -p which
| /usr/X11R6/bin/which
| __> type which
| which is /usr/X11R6/bin/which
 __> command -v which
 /usr/X11R6/bin/which
`----

,----[ zsh, which does not match which's plain output nohow ]
| __> zsh
| __> type -p which
| which is /bin/which
| __> type which   
| which is a shell builtin
| __> command -v which
| which
`----

,----[ ash, which again is more verbose than which ]
| __> ash
| $ type -p which
| -p: not found
| which is /bin/which
| $ command -v which
| /bin/which
`----

,----[ dash, just like ash ]
| __> dash
| $ type -p which
| -p: not found
| which is /bin/which
| $ command -v which
| /bin/which
----

,----[ posh, which does not implement type at all ]
| __> posh
| $ type -p which
| posh: type: not found
| $ command -v which
| command: invalid option -- v
`----

        Given this, I am not sure policy can ratify either type, type
 -p, or command -v as a drop in replacement.

        manoj
-- 
Someone in DAYTON, Ohio is selling USED CARPETS to a SERBO-CROATIAN
Manoj Srivastava <srivasta@debian.org> <http://www.debian.org/~srivasta/>  
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C


Reply to: