Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 May 2000 09:47:31 -0400 (EDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        (Christian Weisgerber) <naddy@mips.inka.de>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: sh prompt
Message-ID:  <20000528134732.CURV22611.mail.rdc1.va.home.com@john.baldwin.cx>
In-Reply-To: <8gqsgm$311u$1@bigeye.mips.inka.de>

next in thread | previous in thread | raw e-mail | index | archive | help

On 28-May-00 Christian Weisgerber wrote:
> Duke Normandin <dnormandin@freewwweb.com> wrote:
> 
>> I have the following prompt in ~/.shrc:
>> 
>> PS1="[$(tty | cut -c9-11)]:`whoami`.`hostname | sed 's/\..*//'`@"`pwd`

You can get the prompt you want rather easily in tcsh using the following:

set prompt='[%l]:%n.%m@%~\n%# '
set promptchats='$#'

[ttyp6]:john.john@/usr/local
$ cd
[ttyp6]:john.john@~
$

> Basically, what you are trying to do is beyond the capabilities of
> sh.

Agreed, sh is more of a scripting shell than an interactive shell, but
that is a matter of heavy personal opinion.

--

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.cslab.vt.edu/~jobaldwi/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/


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?20000528134732.CURV22611.mail.rdc1.va.home.com>