From owner-freebsd-stable Fri Sep 6 11:43:56 2002 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 61F3F37B400 for ; Fri, 6 Sep 2002 11:43:53 -0700 (PDT) Received: from lurza.secnetix.de (lurza.secnetix.de [212.66.1.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9004243E6A for ; Fri, 6 Sep 2002 11:43:52 -0700 (PDT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (localhost [IPv6:::1]) by lurza.secnetix.de (8.12.5/8.12.5) with ESMTP id g86IhnmC066471 for ; Fri, 6 Sep 2002 20:43:50 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.12.5/8.12.5/Submit) id g86IhnHR066470; Fri, 6 Sep 2002 20:43:49 +0200 (CEST) Date: Fri, 6 Sep 2002 20:43:49 +0200 (CEST) Message-Id: <200209061843.g86IhnHR066470@lurza.secnetix.de> From: Oliver Fromme To: freebsd-stable@FreeBSD.ORG Reply-To: freebsd-stable@FreeBSD.ORG Subject: Re: Shell builtin command changed? In-Reply-To: <20020906183733.A51312@sumuk.de> X-Newsgroups: list.freebsd-stable User-Agent: tin/1.5.4-20000523 ("1959") (UNIX) (FreeBSD/4.6-STABLE (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Martin Heinen wrote: > I used command inside a shell function in the following way: > > | cd () { > | command cd $* && PS1="`pwd`# " > | } > > Is this usage of command no longer supported or is it a bug in sh? I don't know about that bug ("command" works for me, but my 4-stable is a few weeks older), but I'd suggest the following definition of the shell function instead: cd(){ chdir "$@" && PS1="`pwd`# ";} chdir is simply a pre-defined alias for cd, so you can use it inside that shell function safely without causing an endless recursion. $@" is better than $* because it deals with whitespace correctly. Regards Oliver -- Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. "All that we see or seem is just a dream within a dream" (E. A. Poe) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message