[TUHS] Arithmetic expansion in Unix shells

Michael Siegel msi at malbolge.net
Mon Jun 21 19:37:52 AEST 2021


Hello,

I'm currently trying out the rc shell (using Byron Rakitzis'
implementation for Unix). Compared to Bash, which I normally use, this
shell has a rather small feature set (which isn't to say that that's
necessarily a bad thing).

Now, one of the features that Bash has and rc doesn't have is the
ability to perform arithmetic expansion. That's not really a problem
because you can just use `expr` instead. I wonder, though, when
arithmetic expansion as a shell built-in became a thing, especially in
POSIX sh.

POSIX has included that feature since at least 2001, and probably quite
some years earlier, given that Bash already had it in 1995 (going by
the manual page of version 1.14.7, the oldest I could find).

So, maybe someone here can help me find out when this was actually
standardized.

Thanks.

--
Michael


More information about the TUHS mailing list