bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Arithmetic expansion with increments and output redirection


From: Greg Wooledge
Subject: Re: Arithmetic expansion with increments and output redirection
Date: Wed, 24 Apr 2019 10:10:00 -0400
User-agent: Mutt/1.10.1 (2018-07-13)

On Wed, Apr 24, 2019 at 09:58:42AM -0400, Chet Ramey wrote:
> The SVR4.2 Bourne shell, as another data point, behaves like bash. Since
> it  doesn't have arithmetic expansion, you have to use something it does
> handle internally, like ${n:=2}. I don't know what ksh88, the other POSIX
> historical reference implementation, does.

# uname -a       
HP-UX vandev B.10.20 A 9000/778 2000153729 two-user license
# exec ksh
# set -o vi
# n=0; : $((n=n+1)); echo "$n"
1
# n=0; /bin/true > $((n=n+1)); echo "$n"
0

Looks like it changed between ksh88 and ksh93.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]