From owner-freebsd-bugs Fri Jun 11 10:14:27 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from misha.cisco.com (misha.cisco.com [171.69.206.50]) by hub.freebsd.org (Postfix) with ESMTP id 5062C14F9F; Fri, 11 Jun 1999 10:14:21 -0700 (PDT) (envelope-from mi@misha.cisco.com) Received: (from mi@localhost) by misha.cisco.com (8.9.3/8.9.1) id NAA58200; Fri, 11 Jun 1999 13:14:17 -0400 (EDT) (envelope-from mi) Message-Id: <199906111714.NAA58200@misha.cisco.com> Subject: Re: bin/12137: something wrong with shell -- functions with arithm expressions In-Reply-To: <199906111710.KAA90425@freefall.freebsd.org> from "gnats-admin@FreeBSD.org" at "Jun 11, 1999 10:10:01 am" To: gnats-admin@FreeBSD.org, freebsd-bugs@FreeBSD.org Date: Fri, 11 Jun 1999 13:14:17 -0400 (EDT) Reply-To: mi@aldan.algebra.com From: Mikhail Teterin X-Mailer: ELM [version 2.4ME+ PL52 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The ``-'' character is also causing troubles. The script: length () { echo $((0+${#1})) } length "abc (def [xyz])" length "abc (def (xyz))" length "abc (def -xyz-)" Produces: 16 15 17 Again, bash and ksh print out 15 for all of the strings... -mi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message