groff
[Top][All Lists]
Advanced

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

Re: [Groff] CVS Build Problem


From: Zvezdan Petkovic
Subject: Re: [Groff] CVS Build Problem
Date: Thu, 5 May 2005 14:40:54 -0400
User-agent: Mutt/1.4.2i

On Thu, May 05, 2005 at 10:42:13AM +0100, Keith MARSHALL wrote:
> Larry Jones wrote, quoting Zvezdan Petkovic:
> >> So the solution is to use command -v.
> >
> > Hardly -- "type" is probably more portable than "command -v" is. 
> > Particularly since "command -v" is optional in the latest version of
> > POSIX (it's part of the User Portability Utilities option).

Well, that changes the things.
So, POSIX has introduced command -v to avoid incompatibility between
type, whence, and which, and then stops making it obligatory, leaving us
with no standard option.  Nice job. :-)

> I agree with Larry here.  For shell portability, the least common
> denominator is Bourne shell, but this doesn't guarantee *ANY* degree of
> POSIX compliance.
> 
> I will *NOT* use "command -v".  It is *NOT* a Bourne shell builtin -- on
> SunOS it is available as an external binary, but how should I use it to
> confirm its own existence in the first place?  What fallback code do I
> specify, if it isn't present?
> 
> In Cygwin's "sh", (which is a renamed "ash"), "command" *IS* a builtin,
> *BUT* it doesn't support *ANY* options, so "command -v" fails, simply
> reporting "-v not found".

AFAIK, ash is a BSD shell used in FreeBSD too.
FreeBSD man page says that it is currently in the process of being
changed to conform to POSIX.
Linux man page for ash says that they expect POSIX compliance by
the time BSD 4.4 is released.
Last time I checked that happened quite a while ago. :-)

BTW, I don't think Cygwin should be a measure of Unix compatibility.

Oh well, forget it.
This is one of those fun things about portability. :-)

> 
> This definitely *ISN'T* any sort of portable solution.
> 
> Regards,
> Keith.

Agreed.
Go for the function.

Regards,

        Zvezdan Petkovic




reply via email to

[Prev in Thread] Current Thread [Next in Thread]