Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Jul 2002 14:44:31 -0500
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Andrew Martin <ugly@inhuman.org>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: 'let' syntax in /bin/sh
Message-ID:  <20020728194431.GD73369@dan.emsphone.com>
In-Reply-To: <20020726221426.21bacb51.ugly@inhuman.org>
References:  <20020726221426.21bacb51.ugly@inhuman.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020728194431.GD73369>