From owner-freebsd-questions Tue Dec 8 10:08:58 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA24171 for freebsd-questions-outgoing; Tue, 8 Dec 1998 10:08:58 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from scientia.demon.co.uk (scientia.demon.co.uk [212.228.14.13]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA23989 for ; Tue, 8 Dec 1998 10:08:23 -0800 (PST) (envelope-from ben@scientia.demon.co.uk) Received: from ben by scientia.demon.co.uk with local (Exim 2.054 #17) id 0znPhX-00083u-00; Tue, 8 Dec 1998 16:09:27 +0000 Date: Tue, 8 Dec 1998 16:09:27 +0000 From: Ben Smithurst To: Markus Cc: freebsd-questions@FreeBSD.ORG Subject: Re: prompt2 Message-ID: <19981208160927.A30957@scientia.demon.co.uk> References: <366C3D88.7C67F93E@ucsd.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <366C3D88.7C67F93E@ucsd.edu> User-Agent: Mutt/0.94.17i (FreeBSD/3.0-CURRENT) Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Markus wrote: > I've searched hi and low but cannot find any info regarding the prompt > shell variable. I've been attempting to set my prompt as the current > working directory such as: > > /usr/home/marke>% > > and have it change when the directory is changed. I was going to do an > alias for cd and maybe change the prompt variable or use the second > prompt variable if I knew how to print it as well but couldn't find the > cd executable, I believe it's a system call??? It's not a system call, `cd' is a command builtin to the shell. (It has to be, external commands don't make any effect on your current shell.) > and couldn't find info > on prompt2. Do you know how to do this?? What shell? In sh, the variable you need is PS1, though it's not easy to do what you want. If you like sh-type shells, take a look at bash in the ports collection (shells/bash2), you can then use something like PS1='\w>% ' to get what you want. It may be possible in csh, or tcsh which is another csh-like shell I believe, though I don't know much about them as I prefer sh or bash. There is a section in one of the Unix FAQs (see comp.answers) on how to do this as well, which might be worth a look. -- Ben Smithurst ben@scientia.demon.co.uk send a blank message to ben+pgp@scientia.demon.co.uk for PGP key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message