From owner-freebsd-questions@FreeBSD.ORG Fri Aug 12 03:26:19 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A49B916A41F for ; Fri, 12 Aug 2005 03:26:19 +0000 (GMT) (envelope-from Qiang.Xu@fujixerox.com) Received: from mx20.fujixerox.co.jp (mx20.fujixerox.co.jp [192.26.96.20]) by mx1.FreeBSD.org (Postfix) with ESMTP id 25CB343D45 for ; Fri, 12 Aug 2005 03:26:16 +0000 (GMT) (envelope-from Qiang.Xu@fujixerox.com) Received: from isvw20.fujixerox.co.jp ([129.249.27.140]) by mx20.fujixerox.co.jp with ESMTP id j7C3Q3rG022955; Fri, 12 Aug 2005 12:26:03 +0900 (JST) Received: from ms20.fujixerox.co.jp (localhost [127.0.0.1]) by isvw20.fujixerox.co.jp with ESMTP id j7C3Q28l024777; Fri, 12 Aug 2005 12:26:02 +0900 (JST) Received: from sgpaphq-smtp01.fujixerox.com ([13.198.8.73]) by ms20.fujixerox.co.jp with ESMTP id j7BMcZQa024159; Fri, 12 Aug 2005 12:26:02 +0900 (JST) Received: from mailhost.sgp.fujixerox.com by sgpaphq-smtp01.fujixerox.com with ESMTP id 116330401123817146; Fri, 12 Aug 2005 11:25:46 +0800 Received: from localhost (localhost [127.0.0.1]) by localhost.sgp.fujixerox.com (Postfix) with SMTP id B27071D9A8; Fri, 12 Aug 2005 11:25:41 +0800 (SGT) Received: from sess.xssc.sgp.xerox.com (unknown [13.198.33.122]) by imss.sgp.fujixerox.com (Postfix) with ESMTP id 6FC8E1D9A6; Fri, 12 Aug 2005 11:25:31 +0800 (SGT) From: Xu Qiang To: dpk , Xu Qiang Date: Fri, 12 Aug 2005 11:29:04 +0800 X-Sent-Folder-Path: Sent Items X-Mailer: Oracle Connector for Outlook 9.0.4 60130 (9.0.2711) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Message-Id: <20050812032531.6FC8E1D9A6@imss.sgp.fujixerox.com> Cc: Giorgos Keramidas , freebsd-questions@freebsd.org Subject: RE: Help on bash script? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Aug 2005 03:26:19 -0000 dpk wrote: > It will work with either 'let' or within an 'arithmetic expansion': > = > $[++var] > let ++var > = > By the way, there is another syntax, from the man page, that seems to > operate identically: > = > $((++var)) and $((var+1)) With "let ++var", the result is still 0, it isn't incremented. With $[++var= ], the result is "0: command not found". "$((++var))" is to the same effect as "let ++var". = $((var+1)) works. But the value of var can't be incremented. = thanks, = Xu Qiang