From owner-freebsd-questions Sun Jul 28 12:44:39 2002 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 E341A37B400 for ; Sun, 28 Jul 2002 12:44:37 -0700 (PDT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 41D2B43E42 for ; Sun, 28 Jul 2002 12:44:37 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.5/8.12.5) id g6SJiVRY006843; Sun, 28 Jul 2002 14:44:31 -0500 (CDT) (envelope-from dan) Date: Sun, 28 Jul 2002 14:44:31 -0500 From: Dan Nelson To: Andrew Martin Cc: freebsd-questions@FreeBSD.ORG Subject: Re: 'let' syntax in /bin/sh Message-ID: <20020728194431.GD73369@dan.emsphone.com> References: <20020726221426.21bacb51.ugly@inhuman.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020726221426.21bacb51.ugly@inhuman.org> X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.1i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In the last episode (Jul 26), Andrew Martin said: > Hello, > > For the life of me I haven't been able to figure out the correct syntax > for using 'let' in the sh that comes with FreeBSD (4.6-STABLE). > > $ let x=0 > let: arith: syntax error: "x=0" just do "x=0". If you want to assign the result of a math expression to a variable, do "y=$(($x+1))". "let ..." is equivalent to "$(( ... ))" -- Dan Nelson dnelson@allantgroup.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message