Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Dec 1998 08:33:52 -0500 (EST)
From:      Thomas Good <tomg@nrnet.org>
To:        Markus <mennis@ucsd.edu>
Cc:        "FreeBSD-questions@FreeBSD.ORG" <freebsd-questions@FreeBSD.ORG>
Subject:   Re: prompt2
Message-ID:  <Pine.LNX.3.96.981208082110.6865B-100000@mailhost.nrnet.org>
In-Reply-To: <19981208151654.S12688@freebie.lemis.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 8 Dec 1998, Greg Lehey wrote:

> On Monday,  7 December 1998 at 20:41:44 +0000, Markus wrote:
> > Hi,
> >
> > I've searched hi and low but cannot find any info regarding the prompt
> > shell variable.  I've been attempting to set my prompt as the current
> > working directory such as:
> >
> > /usr/home/marke>%
> >
> > and have it change when the directory is changed.  I was going to do an
> > alias for cd and maybe change the prompt variable or use the second
> > prompt variable if I knew how to print it as well but couldn't find the
> > cd executable, I believe it's a system call???,
> 
> No, it's not a system call.
> 
> > and couldn't find info on prompt2.  Do you know how to do this??
> 
> It depends on your shell, which you haven't mentioned.  Take a look at
> the man page for your shell.

Hi Markus,

I like a slackware style prompt so I borrowed Patrick's syntax from 
/etc/profile and stuck it in my .profile.  This works for bash...for
other logins that invoke bash as a subshell I put it in my .bashrc.

PS1='`hostname -s`:`pwd`$ '
Looks like you need simply:  PS1='`pwd`>%' or something similar.

For the ksh, I use:  PS1='my_box:$PWD$ ' where my_box is the output from
hostname...

---

BTW, I notice a striking similarity between the FreeBSD and Slackware
setup programs (both written in dialog for starters)...  ;-)

Cheers,
Tom

    ----------- Sisters of Charity Medical Center ----------
                    Department of Psychiatry
                              ----     
 Thomas Good, System Administrator            <tomg@q8.nrnet.org>
 North Richmond CMHC/Residential Services     Phone: 718-354-5528
 75 Vanderbilt Ave, Quarters 8                Fax:   718-354-5056
 Staten Island, NY   10304                    www.panix.com/~ugd
                              ----     
 Powered by PostgreSQL 6.3.2 / Perl 5.004 / DBI-0.91::DBD-PG-0.69 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.3.96.981208082110.6865B-100000>