From owner-freebsd-questions Wed Dec 15 21:58:40 1999 Delivered-To: freebsd-questions@freebsd.org Received: from sasknow.com (h139-142-245-96.ss.fiberone.net [139.142.245.96]) by hub.freebsd.org (Postfix) with ESMTP id 5F4B014CAB for ; Wed, 15 Dec 1999 21:58:28 -0800 (PST) (envelope-from freebsd@sasknow.com) Received: from localhost (freebsd@localhost) by sasknow.com (8.9.3/8.9.3) with ESMTP id XAA88185; Wed, 15 Dec 1999 23:58:54 -0600 (CST) (envelope-from freebsd@sasknow.com) Date: Wed, 15 Dec 1999 23:58:53 -0600 (CST) From: Ryan Thompson To: Duke Normandin <01031149@3web.net> Cc: freebsd-questions Subject: Re: csh prompt In-Reply-To: <000501bf478e$3ef90ae0$579ac5d1@webserver> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, 15 Dec 1999, Duke Normandin wrote: > Hi... Hi, Duke! > I've been reading a Linux shell tutorial and the man pages. ;) > Searched the mailing list for, and found examples of, prompts with > various shells. > > In my ~/.cshrc file: > > set prompt = "' hostname -s'# " > > works. It shouldn't work! Are you sure you typed the above correctly? See below. > Why doesn't the following? > > set prompt = "'whoami'@'hostname -s':$cwd# " > > I keep getting for example: > > 'whoami'@'hostname':/etc# _ You're getting the exec elements spelled out (whoami and hostname) because you've used the wrong quotation marks. When you want to exec something in this fashion, you need to use "backticks" ( ` ). So, instead of 'whoami', you should use `whoami`. AND, you've also hit on another important point with your use of $cwd. Since your prompt is set in your .cshrc file, it is set only when you log in, and is not changed after each command. Therefore, if you ran your .cshrc script while you were in /etc, your prompt is always going to say /etc. :-) Try the following instead (this is actually very similar to what I use): set prompt = "`whoami`@`hostname -s`:`pwd`# " alias cd 'cd \!* ; set prompt = "`whoami`@`hostname -s`:`pwd`# "' alias pushd 'cd \!* ; set prompt = "`whoami`@`hostname -s`:`pwd`# "' alias popd 'popd ; set prompt = "`whoami`@`hostname -s`:`pwd`# "' You may not use pushd and popd (yet), but they've been included for completeness. Suffice to say, everytime you change directories with cd, pushd, or popd, your prompt will be refreshed. For user accounts, you may want to replace the # with a $ to differentiate between userland and the super user. (# is usually reserved for the elite, and represents a true symbol of power :-) Hope this helps, - Ryan --- Ryan Thompson 50% Owner, Technical and Accounts Phone: +1 (306) 664-1161 SaskNow Technologies http://www.sasknow.com #106-380 3120 8th St E Saskatoon, SK S7H 0W2 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message