From owner-svn-src-all@FreeBSD.ORG Tue Dec 21 22:48:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C7A6106566B; Tue, 21 Dec 2010 22:48:56 +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 7C1768FC20; Tue, 21 Dec 2010 22:48:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBLMmumW077784; Tue, 21 Dec 2010 22:48:56 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBLMmuc5077782; Tue, 21 Dec 2010 22:48:56 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201012212248.oBLMmuc5077782@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 21 Dec 2010 22:48:56 +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: r216630 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Dec 2010 22:48:56 -0000 Author: jilles Date: Tue Dec 21 22:48:56 2010 New Revision: 216630 URL: http://svn.freebsd.org/changeset/base/216630 Log: sh(1): Explain why it is a bad idea to use aliases in scripts. Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Tue Dec 21 22:47:34 2010 (r216629) +++ head/bin/sh/sh.1 Tue Dec 21 22:48:56 2010 (r216630) @@ -456,9 +456,10 @@ would become Aliases provide a convenient way for naive users to create shorthands for commands without having to learn how to create functions with arguments. -They can also be -used to create lexically obscure code. -This use is discouraged. +Using aliases in scripts is discouraged +because the command that defines them must be executed +before the code that uses them is parsed. +This is fragile and not portable. .Pp An alias name may be escaped in a command line, so that it is not replaced by its alias value, by using quoting characters within or