On Fri, Mar 16, 2001 at 11:07:07AM +0100, Richard Levitte - VMS Whacker wrote:

>>>   +#
>>>   +# Find the full pathname(s) of bc
>>>   +#
>>>   +findBc()
>>>   +{
>>>   +    IFS=:
>>>   +    for i in $PATH; do
>>>   + eval  test -x $i/bc  -a  ! -d $i/bc && { echo $i/bc ; }
>>>   +    done
>>>   +}

>> On usual shells this looks for files with names such as
>> '/usr/local/bin:/usr/bin:/bin/bc', but not for '/usr/local/bin/bc',
>> '/usr/bin/bc' and '/bin/bc'.

> Uhmmm, is that something you found out by testing, or did you miss the
> line saying IFS=:?

The latter.

>> Also lots of quotes are missing (if variable i had the
>> correct value, "$i/bc" would be the file to look at, not
>> $i/bc).

> Why are those quotes needed?  The only reason I can think if is to
> support paths that contain characters that are subject to expansion or
> separation...

Which they aren't because IFS has been redefined; OK.

>> [...] can we rely on shell functions to work everywhere?

> As far as I know, shell functions are a defined part of sh.

They are now, but this has not always been like that.  The
shell does not look the same everywhere -- we have seen
Ultrix sh to work differently than usual shells, and maybe one
of the systems does not support shell functions yet.  (We
could write a 'shtest' utility that looks for a shell that
supports functions ...)


>> Also, is this really worth the effort? Usually you don't
>> encounter more than two 'bc's on the same system, with GNU
>> bc (if available) in a preferred PATH directory.

> "Usually"...  I think it's worth it.

The worst that can happen if a broken bc occurs earlier in PATH
than a working bc is that bntest output is not automatically
verified; 'make test' will print a warning and continue.
If the bctest script fails on some systems, 'make test' will abort.


-- 
Bodo Möller <[EMAIL PROTECTED]>
PGP http://www.informatik.tu-darmstadt.de/TI/Mitarbeiter/moeller/0x36d2c658.html
* TU Darmstadt, Theoretische Informatik, Alexanderstr. 10, D-64283 Darmstadt
* Tel. +49-6151-16-6628, Fax +49-6151-16-6036
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to