From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31518 invoked from network); 21 Jun 2021 09:58:24 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 21 Jun 2021 09:58:24 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id A0F1A9C79C; Mon, 21 Jun 2021 19:58:21 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 6A1329C5FE; Mon, 21 Jun 2021 19:58:02 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id 8FB519C5FE; Mon, 21 Jun 2021 19:57:58 +1000 (AEST) Received: from freefriends.org (freefriends.org [96.88.95.60]) by minnie.tuhs.org (Postfix) with ESMTPS id 02E329C5F8 for ; Mon, 21 Jun 2021 19:57:57 +1000 (AEST) X-Envelope-From: arnold@skeeve.com Received: from freefriends.org (freefriends.org [96.88.95.60]) by freefriends.org (8.14.7/8.14.7) with ESMTP id 15L9vpZn004497 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 21 Jun 2021 03:57:52 -0600 Received: (from arnold@localhost) by freefriends.org (8.14.7/8.14.7/Submit) id 15L9vpZu004496; Mon, 21 Jun 2021 03:57:51 -0600 From: arnold@skeeve.com Message-Id: <202106210957.15L9vpZu004496@freefriends.org> X-Authentication-Warning: frenzy.freefriends.org: arnold set sender to arnold@skeeve.com using -f Date: Mon, 21 Jun 2021 03:57:51 -0600 To: tuhs@minnie.tuhs.org, msi@malbolge.net References: <20210621113752.110edede@moon> In-Reply-To: <20210621113752.110edede@moon> User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [TUHS] Arithmetic expansion in Unix shells X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" Arithmetic expansion dates back at least as far as ksh88. Bash likely picked it up from there. The original was only integer math and Bash remains that way (IIRC, Chet can correct me if I'm wrong). ksh93 added floating point math. POSIX would have picked it up from ksh88. HTH, Arnold Michael Siegel wrote: > 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