From owner-freebsd-questions Fri Sep 26 10:42:59 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id KAA18207 for questions-outgoing; Fri, 26 Sep 1997 10:42:59 -0700 (PDT) Received: from horton.iaces.com (proot@horton.iaces.com [204.147.87.98]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id KAA18193 for ; Fri, 26 Sep 1997 10:42:49 -0700 (PDT) Received: (from proot@localhost) by horton.iaces.com (8.8.5/8.8.5) id MAA13456; Fri, 26 Sep 1997 12:42:02 -0500 (CDT) From: "Paul T. Root" Message-Id: <199709261742.MAA13456@horton.iaces.com> Subject: Re: Setting PS1 To: hanspb@persbraten.vgs.no (Hans Petter Bieker) Date: Fri, 26 Sep 1997 12:42:02 -0500 (CDT) Cc: jm@pluriproj.pt, freebsd-questions@FreeBSD.ORG In-Reply-To: from Hans Petter Bieker at "Sep 26, 97 03:28:03 pm" X-Organization: !nterprise Networking Services - ACES X-Phone: (612) 664-3385 X-Fax: (612) 664-4779 X-Page: (800) SKY-PAGE PIN: 537-7270 X-Address: 600 Stinson Blvd, Fl 1S X-Address: Minneapolis, MN 55413 X-Mailer: ELM [version 2.4ME+ PL22 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk In a previous message, Hans Petter Bieker said: > On Fri, 26 Sep 1997, Jose Monteiro wrote: > > > jose@thor /usr/local$ cd bin > > jose@thor /usr/local/bin$ > > In bash: > > [hanspbie@zerium ~]$ echo $PS1 > [\u@\h \w]\$ > [hanspbie@zerium ~]$ cd /usr/local > [hanspbie@zerium /usr/local]$ > > ... does anyone know how to do this in sh (sorry, I don't have sh on > this Linux box ;) )? You have to do with functions. Something like: export HOST HOST=`hostname` mycd () { cd $* PWD=`pwd` PS1="[${USER}@${HOST} ${PWD%$HOME}]\$ " } Paul. > -- > Linux; 64bit, multi-platform, multi-tasking, multi-user, fast and Free. > Microsoft Windows 95 - From the makers of EDLIN and FAT drive formatting! > "Who needs horror movies when we have Microsoft"? > -- 'Twas brillig, and the slithy toves All mimsy were the borogoves, Did gyre and gimble in the wabe: and the mome raths outgrabe. -- Lewis Caroll