From owner-freebsd-questions Thu Nov 25 15: 6:15 1999 Delivered-To: freebsd-questions@freebsd.org Received: from inet03.citec.qld.gov.au (inet03.citec.qld.gov.au [203.5.10.10]) by hub.freebsd.org (Postfix) with ESMTP id 3212614F3B for ; Thu, 25 Nov 1999 15:06:11 -0800 (PST) (envelope-from sgcccdc@citec.qld.gov.au) Received: by inet03.citec.qld.gov.au; id JAA07030; Fri, 26 Nov 1999 09:05:57 +1000 (EST) Received: from guru.citec.qld.gov.au( 147.132.20.47) by inet03.citec.qld.gov.au via smap (V2.0) id xma006885; Fri, 26 Nov 99 09:05:49 +1000 Received: from localhost (sgcccdc@localhost) by guru.citec.qld.gov.au (8.9.3/8.9.3) with ESMTP id JAA19479; Fri, 26 Nov 1999 09:05:52 +1000 X-Authentication-Warning: guru.citec.qld.gov.au: sgcccdc owned process doing -bs Date: Fri, 26 Nov 1999 09:05:52 +1000 (EST) From: Colin Campbell To: Oren Sarig Cc: Guillaume Paquet , freebsd-questions@FreeBSD.ORG Subject: Re: prompt and default editor In-Reply-To: <05a601bf3772$4ba57fc0$470cb3d4@asmodean> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, On Thu, 25 Nov 1999, Oren Sarig wrote: > 1) How can I change my prompt? like myhostname@pwd$ > I'd like to have an example please. > > It depends on the shell, for example, in bash you would do a > PS1=""; export PS1 > Here's a PS1 I developed for ksh/bash/... PS1="`uname -n|cut -f1 -d.` "'${PWD%%/*/*}${PWD##${PWD%/*/*}} \$ ' For root, I add "|tr a-z A-Z" between the "d." and the "'" (uppercases the hostname so I can tell easier if I am root or me). It has the "magical" feature of showing only the last two components of the cwd. I like having some indication of where I am in the file system, but I also really hate having a prompt that fills the whole line. Here's an example: Hostname = myhost.my.domain.com pwd = /usr/local/share/doc/apache If I am me it looks like: myhost /doc/apache # and if I am root it looks like MYHOST /doc/apache # Colin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message