On Thu, Feb 28, 2008 at 01:35:39AM +0100, Roland Mainz wrote:
> Nicolas Williams wrote:
> > On Thu, Feb 28, 2008 at 12:10:30AM +0100, Roland Mainz wrote:
> > > Nicolas Williams wrote:
> > > > > > +[[ $# -eq 3 ]] || {
> > > > >
> > > > > Ouch... both /usr/bin/ksh and /usr/bin/ksh93 support builtin math and
> > > > > comparing strings using the "test" builtin is a bit sub-optimal, 
> > > > > please
> > > > > use
> > > >
> > > > Ouch what?  [[ ... ]] uses the built-in test, and surely costs nothing
> > > > measurable in this case.
> > >
> > > Erm... (( )) is a math expression which uses the internal representation
> > 
> > [long explanation elided]
> > 
> > I understand, but I this makes not an iota of difference here.
> 
> Grumpf... think about it this way: in C/C++ you use |int| and not |char
> *| to compare numbers. My request is to do the same in this case and
> compare numbers as numbers and not as "strings". Unlike the
> Thomson/Bourne shells the ksh/ksh93/POSIX shells support numeric
> datatypes which should be handled via (( )) and not [[ ]] ...

OK, I don't have to but I will do this.

> > Is it a KSH88 built-in?  If not, then forget it :)
> 
> AFAIK it's a ksh88 builtin command (I don't have the matching Solaris
> sources as "proof" ... but the code for symbols for "true" are near
> similar symbols for "false" which means they're likely both builtin
> commands (or somehow else clustered together). For ksh93 the status of
> builtin commands can be checked (much easier) using the $ builtin #
> command).

I trussed ksh and sure enough, it's built-in.  So I'll do this too.

Nico
-- 

Reply via email to