Re: arithmetic substitution in while loop in MKS Korn shell

From: David Thompson (dat1965_at_yahoo.com)
Date: 10/02/03


Date: Thu, 02 Oct 2003 03:11:45 GMT


"Chris F.A. Johnson" <c.f.a.johnson@rogers.com> wrote

> the MKS Korn shell is supposed to be compatible with ksh93.

Oh?

I don't think that's quite true. MKS provides a subset only,
but I've never seen it fully documented just what this subset
is. For example, ksh93 supports arithmetic expressions using
the (( expr )) syntax,

  X=1
  (( X = X + 1 ))

but MKS most definitely does not.

ksh93 has 1) arithmetic expressions and 2) arithmetic substitutions,
but MKS only has #2, ie,

  1) arithmetic expression (( X = X + 1 ))
  2) arithmetic substitution X=$(( X + 1 ))

OTOH, I've never seen explicit claims to be a subset of ksh93,
or be compatible with ksh93 either. Ie, this page below never
mentions ksh93,

http://www.mkssoftware.com/docs/man1/sh.1.asp

although it does mention POSIX.2 compatibility.

-- 
David Thompson
Foster City, CA