Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Feb 2002 13:42:59 -0500
From:      "Morse, Richard E." <REMORSE@PARTNERS.ORG>
To:        'DragonRyder' <dragonr@xmission.com>, freebsd-questions@FreeBSD.ORG
Subject:   RE: Prompt Help
Message-ID:  <375F68784081D511908A00508BE3BB17DDDBBB@phsexch22.mgh.harvard.edu>

next in thread | raw e-mail | index | archive | help
Hi!  This will vary from shell to shell, so the first thing you need to know is
what shell you are using.  I'm going to assume that you are using FreeBSD here,
because that is the list you posted to.

There are several ways to find out which shell you are using.  One way is to
type 'ps' at the prompt.  This will return a list of the currently running
processes being run by the current user.  In my case, I get told that one of the
processes is 'tcsh', which is a shell.  In general, shell names end with 'sh'.
Common shells are 'sh', 'tcsh', 'csh', 'bash', 'ksh', and 'ash'.  Another option
is to look in /etc/passwd for your entry to see if what shell you are using.
You can also do a 'chsh', which allows you to change the shell.

Once you know which shell you are using, you need to read the man page for that
shell.  IE, type 'man tcsh', or 'man bash', or 'man sh' at the prompt.  It's
probably a good idea to read this manpage anyways.  This will tell you something
about which files are accessed at startup, so that you can tell where to look
for any currently existing prompt statements and modify them.

Just off the top of my head, in either csh or tcsh, you would do something like
	set prompt = '[%n@%m %/]%# "
and in bash you need to export PS1, I think -- I've not had to configure bash as
much, and right now I don't have a bash manpage available, as it isn't installed
on my FreeBSD box...

HTH,
Ricky

-----Original Message-----
From: DragonRyder [mailto:dragonr@xmission.com]
Sent: Thursday 21 February 2002 12:44 PM
To: freebsd-questions@FreeBSD.ORG
Subject: Prompt Help


I am new to UNIX and FreeBSD. I just started the first month of a
three month course on UNIX Programming. I am enjoying the class and
look forward to learning more about this OS.

My question is this...
I don't like using pwd to determine where I am everytime I go to use a
command. Is there a way of changing the prompt so I don't have to use
the pwd all the time?

NOTE: The server that I am using for my class is my own hard drive. We
reformat the drives and install UNIX on a daily bases. Therefore, if I
mess up on the commands and instructions you give me, I can always
install and try again.

Thank you for your help,
Jef Sullivan

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

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?375F68784081D511908A00508BE3BB17DDDBBB>