[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Intriguing error with arithmetic evaluation
From: |
Stephane Chazelas |
Subject: |
Re: Intriguing error with arithmetic evaluation |
Date: |
Wed, 24 Aug 2016 15:01:09 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
2016-08-23 12:26:37 -0400, Greg Wooledge:
[...]
> > ksh -c '((0)); echo X'
> >
> > outputs X
>
> You forgot the -e. Here's ksh88:
>
> $ ksh -e -c '((0)); echo X'
> $ uname -a
> HP-UX imadev B.10.20 A 9000/785 2008897791 two-user license
[...]
Oops.
I did test with -e on Solaris though
$ Version M-11/16/88i
$ ksh -ec '((0)); echo X'
X
$ /usr/xpg4/bin/sh -ec '((0)); echo X'
X
(That sh being a slightly modified version of ksh88i to address
POSIX compliance IIRC).
Possibly HP-UX changed it? Sounds more likely than
Solaris changing it the other way round.
What version of ksh is it based on?
--
Stephane
Re: Intriguing error with arithmetic evaluation, Stephane Chazelas, 2016/08/23