Date: Fri, 26 Sep 1997 12:42:02 -0500 (CDT) From: "Paul T. Root" <proot@horton.iaces.com> To: hanspb@persbraten.vgs.no (Hans Petter Bieker) Cc: jm@pluriproj.pt, freebsd-questions@FreeBSD.ORG Subject: Re: Setting PS1 Message-ID: <199709261742.MAA13456@horton.iaces.com> In-Reply-To: <Pine.LNX.3.95.970926152341.1977B-100000@zerium.newmedia.no> from Hans Petter Bieker at "Sep 26, 97 03:28:03 pm"
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199709261742.MAA13456>
