From owner-freebsd-questions@FreeBSD.ORG Thu Jul 29 14:32:18 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5BC0316A4CE for ; Thu, 29 Jul 2004 14:32:18 +0000 (GMT) Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5206743D41 for ; Thu, 29 Jul 2004 14:32:17 +0000 (GMT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost.infracaninophile.co.uk [IPv6:::1])i6TEWCrU071264 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 29 Jul 2004 15:32:12 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)id i6TEWCOF071263; Thu, 29 Jul 2004 15:32:12 +0100 (BST) (envelope-from matthew) Date: Thu, 29 Jul 2004 15:32:12 +0100 From: Matthew Seaman To: Dan Message-ID: <20040729143212.GB28698@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , Dan , freebsd-questions@freebsd.org References: <000801c47570$25df3ab0$ca2aeecd@dannewxp> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jq0ap7NbKX2Kqbes" Content-Disposition: inline In-Reply-To: <000801c47570$25df3ab0$ca2aeecd@dannewxp> User-Agent: Mutt/1.5.6i X-Greylist: Message not sent from an IPv4 address, not delayed by milter-greylist-1.5.3 (smtp.infracaninophile.co.uk [0.0.0.0]); Thu, 29 Jul 2004 15:32:12 +0100 (BST) X-Virus-Scanned: clamd / ClamAV version devel-20040705, clamav-milter version 0.74a on smtp.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on happy-idiot-talk.infracaninophile.co.uk cc: freebsd-questions@freebsd.org Subject: Re: freeBSD How to you set the prompt X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jul 2004 14:32:18 -0000 --jq0ap7NbKX2Kqbes Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 29, 2004 at 01:29:30PM -0000, Dan wrote: > Where and how do you set the prompt to show what user name that your on= IE ROOT or user johndoe. > Eample of what the end results I would like to see. >=20 > # router1.pdx/chatusa.com user johndoe. Depends on what shell you're using. Assuming that you meant to type 'router1.pdx.chatusa.com' as the fully qualified hostname, then for tcsh(1): set prompt=3D"# %M user %n " For bash(1): PS1=3D"# \H user \u " For zsh(1): prompt=3D"# %M user %n " For sh(1), which doesn't have any sort of escape character support for its prompts, you'ld have to do something like: PS1=3D"# $(hostname) user $(id -un)" which just uses the regular string substition features supplied by the shell. [The difference is immaterial here, but if you wanted, say, to display the current working directory in your shell prompt, the %-escape or \-escape style would do it without any fuss. The sh(1) style means you'ld have to arrange to reset the prompt each time you changed directory.] Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK --jq0ap7NbKX2Kqbes Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFBCQpsiD657aJF7eIRAnQiAKCikSoojHI2XwluxMeOZa9+c3SF3gCgiEg3 GVXAbvccVkSh6K9vF5uhgJI= =FiqD -----END PGP SIGNATURE----- --jq0ap7NbKX2Kqbes--