[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.
- Re: Arithmetic expansion with increments and output redirection, (continued)
- Re: Arithmetic expansion with increments and output redirection, Robert Elz, 2019/04/24
- Re: Arithmetic expansion with increments and output redirection, Ian Neal, 2019/04/24
- Re: Arithmetic expansion with increments and output redirection, Greg Wooledge, 2019/04/24
- Re: Arithmetic expansion with increments and output redirection, Andreas Schwab, 2019/04/24
- Re: Arithmetic expansion with increments and output redirection, Chet Ramey, 2019/04/24
- Re: Arithmetic expansion with increments and output redirection, Chet Ramey, 2019/04/24
- Re: Arithmetic expansion with increments and output redirection, Ian Neal, 2019/04/24
- Re: Arithmetic expansion with increments and output redirection, Chet Ramey, 2019/04/24
- Re: Arithmetic expansion with increments and output redirection, Ilkka Virta, 2019/04/24
- Re: Arithmetic expansion with increments and output redirection, Chet Ramey, 2019/04/24
- Re: Arithmetic expansion with increments and output redirection,
Greg Wooledge <=
- Re: Arithmetic expansion with increments and output redirection, Ian Neal, 2019/04/24
- Re: Arithmetic expansion with increments and output redirection, Chet Ramey, 2019/04/24
- Re: Arithmetic expansion with increments and output redirection, Chet Ramey, 2019/04/24