[Top][All Lists]
[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: |
Wed, 4 May 2005 15:01:45 -0400 |
User-agent: |
Mutt/1.4.2i |
On Tue, May 03, 2005 at 10:26:45AM -0400, Larry Jones wrote:
> Keith MARSHALL writes:
> >
> > Really? I didn't know that, sorry. I used `type' to check that all of the
> > necessary prerequisite programs are installed, because I understood that it
> > *was* standard in Bourne shell; I've never come across one that didn't have
> > it, but my experience has been exclusively with System V, (since SVR2), and
> > more recently with GNU/Linux.
>
> To my knowledge, it has *never* been in the Bourne shell, it is the Korn
> shell's (ksh) answer to the C shell's "which" command. On SysV, it is
> fairly common to have sh be a link to ksh rather than being the real
> Bourne shell (that's how David Korn "proved" that ksh was completely
> upward compatible with sh -- he replaced sh with ksh on many of AT&T's
> systems and no one noticed), which is probably the source of your
> confusion.
Well, like it or not, Korn shell was the basis for POSIX. :-)
I personally like that.
For what it's worth, type is just an alias for whence -v in Korn shell.
See below for portable way to do this.
> > I followed the portability guidelines in the
> > Autoconf documentation, which does not list `type' as a non-portable Bourne
> > shell builtin, (in the `info' for 2.59) :-(
>
> Probably for the same reason it doesn't list "foobar" as a non-portable
> Bourne shell builtin. :-) The current more-or-less definitive
> specification of the shell command language is that specified by the
> Single UNIX Specification/POSIX:
>
>
> <http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html>
>
> The built-ins are on a separate page:
>
> <http://www.opengroup.org/onlinepubs/009695399/idx/sbi.html>
>
> > 3) For each test currently implemented using `type', reproduce the program
> > file location strategy used by Autoconf; this is likely to result in the
> > most portable solution, but is rather long winded.
> >
> > 4) Implement `type' as a shell function, based on the Autoconf strategy,
> > within `pdfroff.sh'; this would appear to be the most attractive option,
> > *but* the Autoconf documentation says not to use shell functions.
>
> I agree with your analysis. For what it's worth, CVS (which is also GNU
> software and widely portable) has the same problem in its test suite
> (although not in the core product) and uses a shell function to solve
> it. In fact, the test suite makes extensive use of shell functions. So
> I suggest going with 4: it's inifinitely better than using "type" and it
> seems to be "portable enough".
No need for the shell function.
POSIX specifies this:
The command -v and -V options were added to satisfy requirements
from users that are currently accomplished by three different
historical utilities: type in the System V shell, whence in the
KornShell, and which in the C shell. Since there is no
historical agreement on how and what to accomplish here, the
POSIX command utility was enhanced and the historical utilities
were left unmodified. The C shell which merely conducts a path
search. The KornShell whence is more elaborate-in addition to
the categories required by POSIX, it also reports on tracked
aliases, exported aliases, and undefined functions.
So the solution is to use command -v.
All the best.
Zvezdan Petkovic
- Re: [Groff] CVS Build Problem, Keith Marshall, 2005/05/01
- Re: [Groff] CVS Build Problem, Larry Jones, 2005/05/02
- Re: [Groff] CVS Build Problem, Keith MARSHALL, 2005/05/03
- Re: [Groff] CVS Build Problem, Larry Jones, 2005/05/03
- Re: [Groff] CVS Build Problem,
Zvezdan Petkovic <=
- Re: [Groff] CVS Build Problem, Keith MARSHALL, 2005/05/03
- Re: [Groff] CVS Build Problem, Larry Jones, 2005/05/03
- Re: [Groff] CVS Build Problem, Keith MARSHALL, 2005/05/05
- Re: [Groff] CVS Build Problem, Werner LEMBERG, 2005/05/05
- Re: [Groff] CVS Build Problem, Keith Marshall, 2005/05/06
- Re: [Groff] CVS Build Problem, Keith Marshall, 2005/05/06
- Re: [Groff] CVS Build Problem, Werner LEMBERG, 2005/05/07
- Re: [Groff] CVS Build Problem, Keith Marshall, 2005/05/07
- Re: [Groff] CVS Build Problem, Keith Marshall, 2005/05/14