'\" te .\" Copyright (c) 2007 Sun Microsystems, Inc. - All Rights Reserved. .\" Copyright 1989 AT&T .\" Portions Copyright (c) 1982-2007 AT&T Knowledge Ventures .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] .TH let 1 "2 Nov 2007" "SunOS 5.11" "User Commands" .SH NAME let \- shell built-in function to evaluate one or more arithmetic expressions .SH SYNOPSIS .SS "ksh" .LP .nf \fBlet\fR \fIarg\fR... .fi .SS "ksh93" .LP .nf \fBlet\fR [\fIexpr\fR...] .fi .SH DESCRIPTION .SS "ksh" .sp .LP Each \fIarg\fR is a separate arithmetic expression to be evaluated. .SS "ksh93" .sp .LP \fBlet\fR evaluates each \fIexpr\fR in the current shell environment as an arithmetic expression using ANSI C syntax. Variables names are shell variables and they are recursively evaluated as arithmetic expressions to get numerical values. \fBlet\fR has been made obsolete by the \fB((...))\fR syntax of \fBksh93\fR(1) which does not require quoting of the operators to pass them as command arguments. .SH EXIT STATUS .SS "ksh" .sp .LP \fBksh\fR returns the following exit values: .sp .ne 2 .mk .na \fB\fB0\fR\fR .ad .RS 5n .rt The value of the last expression is \fBnon-zero\fR. .RE .sp .ne 2 .mk .na \fB\fB1\fR\fR .ad .RS 5n .rt The value of the last expression is zero. .RE .SS "ksh93" .sp .LP \fBksh93\fR returns the following exit values: .sp .ne 2 .mk .na \fB\fB0\fR\fR .ad .RS 6n .rt The last \fIexpr\fR evaluates to a \fBnon-zero\fR value. .RE .sp .ne 2 .mk .na \fB\fB>0\fR\fR .ad .RS 6n .rt The last \fIexpr\fR evaluates to \fB0\fR or an error occurred. .RE .SH SEE ALSO .sp .LP \fBksh\fR(1), \fBksh93\fR(1), \fBset\fR(1), \fBtypeset\fR(1), \fBattributes\fR(5)