From owner-freebsd-questions Tue Jul 9 23:31:16 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id XAA14387 for questions-outgoing; Tue, 9 Jul 1996 23:31:16 -0700 (PDT) Received: from mail.EUnet.hu (mail.eunet.hu [193.225.28.100]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id XAA14368 for ; Tue, 9 Jul 1996 23:31:10 -0700 (PDT) Received: by mail.EUnet.hu, id IAA04332; Wed, 10 Jul 1996 08:31:04 +0200 Received: by CoDe.CoDe.hu (SAA01798); Tue, 9 Jul 1996 18:57:54 GMT From: Gabor Zahemszky Message-Id: <199607091857.SAA01798@CoDe.CoDe.hu> Subject: Re: Changing prompt To: freebsd-questions@freebsd.org Date: Tue, 9 Jul 1996 18:57:54 +0000 (GMT) Cc: rcutter@ctgusa.com In-Reply-To: <1.5.4.32.19960705154424.008cda38@ctgusa.com> from "Ryan Cutter" at Jul 5, 96 11:44:24 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > Hi, > > How can I change my prompt in FreeBSD to reflect the current > directory I'm in? You saw it in csh/bash. Tcsh is the same as csh, (pd)ksh is the same as bash, but you cannot do the \X stuff, only PS1='$PWD > '. And finally here it is in the standard shell (sh, precisely: ash): cd() { chdir "$@" PS1="`pwd` > " } (It works only in FBSD's sh, in traditional shells, you cannot make a function using the same name as an internal command; and in traditional sh's hasn't got chdir.) -- Gabor Zahemszky -:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:- Earth is the cradle of human sense, but you can't stay in the cradle forever. Tsiolkovsky