Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Mar 2000 17:09:25 +0300
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        Vodyanoi <hawk76@mail.ev1.net>
Cc:        FreeBSD Mail List -- Houston <hou-freebsd@cityscope.net>, FreeBSD-Questions <freebsd-questions@freebsd.org>
Subject:   Re: Prompt and Path questions
Message-ID:  <20000329170925.C10131@hades.hell.gr>
In-Reply-To: <200003290559.AA228787102@mail.ev1.net>; from hawk76@mail.ev1.net on Wed, Mar 29, 2000 at 05:59:35AM -0600
References:  <200003290559.AA228787102@mail.ev1.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Mar 29, 2000 at 05:59:35AM -0600,  Vodyanoi wrote:
>
>   I appear to have a small issue with the setup of both my path and
>   prompt settings. I am using sh for my shell. I have edited the
>   prompt setting in the .shrc file in the home dir but it didn't work
>   quite the way I expected it to.

Please change your mailer settings to wrap text at 70 characters or so.
It looks rather funny when an entire paragraph's text scrolls away in
one single line.

> PS1="`whoami`@`hostname | sed 's/\..*//'`"
>  case `id -u` in
>         0) PS1="${PS1}|`pwd`# ";;
>         *) PS1="${PS1}|`pwd`$ ";;
>  esac

This sets the prompt only once.  To have PS1 updated each time you
change your working directory, you can do one of two things:

a) Install bash from the ports (shells/bash1 or shells/bash2), and set
   your PS1 in .bashrc with:

	export PS1='\u@\h|\w\$ '

b) Make `cd' a shell function, that calls `chdir' to do the actual
   change of the path, and updates PS1 with `pwd` again.  Something
   like:

	cd () {
	    chdir "$@";
	    PS1="$USER$`hostname | cut -d. -f1`|`pwd`$ ";
	    export PS1;
	}

   of course, this is an ugly cludge, since if you use `chdir' instead
   of `cd', your PS1 will not be updated :/

- Giorgos Keramidas


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?20000329170925.C10131>