From owner-svn-src-head@FreeBSD.ORG Fri May 27 20:53:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71E43106566B; Fri, 27 May 2011 20:53:07 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 629778FC16; Fri, 27 May 2011 20:53:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4RKr7OM052582; Fri, 27 May 2011 20:53:07 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4RKr7Ls052579; Fri, 27 May 2011 20:53:07 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201105272053.p4RKr7Ls052579@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 27 May 2011 20:53:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222386 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2011 20:53:07 -0000 Author: jilles Date: Fri May 27 20:53:07 2011 New Revision: 222386 URL: http://svn.freebsd.org/changeset/base/222386 Log: sh: Remove the "exp" builtin. The "exp" builtin is undocumented, non-standard and not very useful. If exp's return value is not used, something like VAR=$(exp EXPRESSION) is equivalent to VAR=$((EXPRESSION)) except that errors in the expression are fatal and quoting special characters is not needed in the latter case. If exp's return value is used, something like if exp EXPRESSION >/dev/null can be replaced by if [ $((EXPRESSION)) -ne 0 ] with similar differences. The exp-run showed that "let" is close enough to bash's and ksh's builtin that removing it would break a few ports. Therefore, "let" remains in 9.x. PR: bin/104432 Exp-run done by: pav (with some other sh(1) changes) Modified: head/bin/sh/arith_yacc.c head/bin/sh/builtins.def Modified: head/bin/sh/arith_yacc.c ============================================================================== --- head/bin/sh/arith_yacc.c Fri May 27 20:34:23 2011 (r222385) +++ head/bin/sh/arith_yacc.c Fri May 27 20:53:07 2011 (r222386) @@ -344,7 +344,7 @@ arith_t arith(const char *s) * The exp(1) builtin. */ int -expcmd(int argc, char **argv) +letcmd(int argc, char **argv) { const char *p; char *concat; Modified: head/bin/sh/builtins.def ============================================================================== --- head/bin/sh/builtins.def Fri May 27 20:34:23 2011 (r222385) +++ head/bin/sh/builtins.def Fri May 27 20:53:07 2011 (r222386) @@ -60,7 +60,7 @@ echocmd echo evalcmd -s eval execcmd -s exec exitcmd -s exit -expcmd exp let +letcmd let exportcmd -s export -s readonly #exprcmd expr falsecmd false