From: john@nextdoor.com (John McCracken)
Newsgroups: comp.sys.next.misc
Subject: Re: How do I make shell prompt show working directory?
Date: 7 Apr 92 07:27:25 GMT
Article-I.D.: nextdoor.1992Apr7.072725.6379
Reply-To: john@nextdoor.com
Organization: Nextdoor Software, San Jose, CA, USA

In article <basiji.702614445@milton> basiji@milton.u.washington.edu (David  
Basiji) writes:
> 
> The subject pretty much says it all.  I really miss this from my life
> in the DOS world.  How do I modify my .cshrc or .login to make this 
> happen?  
>

I use /bin/csh as the default shell, and here's what I have in my .login file:

	set myhost=`hostname`
	alias SetPrompt 'set prompt="${myhost} [$cwd]-\\!% "'
	alias cd        'cd \!* && SetPrompt'
	alias cdl       'cd \!*; ls'
	cd

This yields a prompt like:

	nextdoor [/john/Library]-3% 

where "nextdoor" is the host, "/john/Library" is the current working directory,
and "3" is the command number.  The "cd" command has been modified to update
the prompt whenever I change directories, and "cdl" changes directories and
gives a listing of the new directory's contents.

-- 
 John McCracken
 john@nextdoor.com

From nether@wpi.WPI.EDU Tue Apr  7 08:37:36 1992
Received: from wpi.WPI.EDU by milton.u.washington.edu
	(5.65/UW-NDC Revision: 2.22 ) id AA04042; Tue, 7 Apr 92 08:37:32 -0700
Received: by wpi.WPI.EDU (5.65/4.7)
	id AA00314; Tue, 7 Apr 92 11:37:26 EST
Date: Tue, 7 Apr 92 11:37:26 EST
From: nether@wpi.WPI.EDU (Joel C Belog)
Message-Id: <9204071537.AA00314@wpi.WPI.EDU>
To: basiji@milton.u.washington.edu
Subject: Re: How do I make shell prompt show working directory?
Newsgroups: comp.sys.next.misc
Organization: Worcester Polytechnic Institute
Cc: 
Status: R

In article <basiji.702614445@milton> you write:
>
>The subject pretty much says it all.  I really miss this from my life
>in the DOS world.  How do I modify my .cshrc or .login to make this 
>happen?  
>
>Thanks,
>Dave

In your .login file, add the lines:

set prompt="{$USER@$HOST %//} Query:: "


P.S.  Quesry:: and the {}`s are just my little thing.  If all you want is a
directory, then:

	set prompt="$USER@HOST %//> "


will work.  Explore a bit till you feel your prompt is comfortable and 
does not strain the eyes :)

Luck,

Joel Belog
	nether@wpi.wpi.edu

From samurai@uriel.cs.mcgill.ca Tue Apr  7 08:56:24 1992
Received: from opus-tc.CS.McGill.CA by milton.u.washington.edu
	(5.65/UW-NDC Revision: 2.22 ) id AA09819; Tue, 7 Apr 92 08:56:20 -0700
Received: from uriel.CS.McGill.CA by opus.cs.mcgill.ca with SMTP (5.65a/IDA-1.4.2c/SOCS-Guru-2c)
        id AA15821  (mail destined for basiji@milton.u.washington.edu) on Tue, 7 Apr 92 11:56:07 -0400
Received: by  uriel.cs.mcgill.ca  (NeXT-1.0 (From Sendmail 5.52)/NeXT-2.0)
	id AA02630; Tue, 7 Apr 92 11:56:02 EDT
Date: Tue, 7 Apr 92 11:56:02 EDT
From: samurai@uriel.cs.mcgill.ca (Darcy Brockbank)
Message-Id: <9204071556.AA02630@ uriel.cs.mcgill.ca >
Received: by NeXT Mailer (1.63.RR)
To: basiji@milton.u.washington.edu (David Basiji)
Subject: Re: How do I make shell prompt show working directory?
Status: R

In comp.sys.next.misc article <basiji.702614445@milton> you wrote:
> 

> The subject pretty much says it all.  I really miss this from my life
> in the DOS world.  How do I modify my .cshrc or .login to make this 

> happen?  

> 

> Thanks,
> Dave
> basiji9@u.washington.edu

Add these lines to your .cshrc:

set host="`hostname| sed 's/\..*//'`"
alias mprompt   'set prompt="[$host] [`pwd`] "'
mprompt

- darcy

--
--------------------------------------------------------------------
"You fill in the mortar, I build the wall." "...a secret stigma, 

weeping willow, a diminished carnival of sorts." "Who might leave you
where I left off? A perfect circle of acquaintances and friends."
"I can't see myself at thirty I don't buy a lack of thirty
Caught like flies wishing for tomorrow's jewlery" - M. Stipe

From wrb@ulnar Tue Apr  7 10:42:02 1992
Received: from bashful.u.washington.edu by milton.u.washington.edu
	(5.65/UW-NDC Revision: 2.22 ) id AA13281; Tue, 7 Apr 92 10:41:59 -0700
Received: from ulnar.biostr.washington.edu by bashful.u.washington.edu
	(5.65/UW-NDC Revision: 2.22 ) id AA18307; Tue, 7 Apr 92 10:41:57 -0700
Received: by  ulnar.biostr.washington.edu  (NeXT-1.0 (From Sendmail 5.52)/NeXT-2.0 (wrb: 4/2/92))
	id AA01473; Tue, 7 Apr 92 10:38:23 PDT
Date: Tue, 7 Apr 92 10:38:23 PDT
From: wrb@ulnar.biostr.washington.edu   (Bill Barker)
Message-Id: <9204071738.AA01473@ ulnar.biostr.washington.edu >
Received: by NeXT Mailer (1.63)
To: basiji@milton.u.washington.edu (David Basiji)
Subject: Re: How do I make shell prompt show working directory?
Status: R

In comp.sys.next.misc article <basiji.702614445@milton> you wrote:
> 

> The subject pretty much says it all.  I really miss this from my life
> in the DOS world.  How do I modify my .cshrc or .login to make this 

> happen?  

> 

> Thanks,
> Dave
> basiji9@u.washington.edu

Dave,

Here's what I do.  It's a two-step procedure (not unusual for UNIX).  First your set the  
prompt.  That takes care of the first time you open a new shell.  Then you change the  
behavior of the cd command so when you cd to some other dir, it reflects the new dir  
location in the prompt.  Put these in your .cshrc file (if you're using csh when in Terminal).

set prompt=${host}:"$cwd> "
alias cd 'cd \!*;set prompt=${host}:"$cwd> " '

Have fun. 


bb
--
Bill Barker--Biological Structure--University of Washington--Seattle--WA--98195
(206) 543-7315

From andre@ramsey.cs.laurentian.ca Tue Apr  7 13:14:42 1992
Received: from ramsey.cs.laurentian.ca by milton.u.washington.edu
	(5.65/UW-NDC Revision: 2.22 ) id AA07118; Tue, 7 Apr 92 13:14:22 -0700
Received: by ramsey.cs.laurentian.ca (5.57/Ultrix3.0-C) id AA13705; Tue, 7 Apr 92 16:13:21 -0400
Date: Tue, 7 Apr 92 16:13:21 -0400
From: andre@ramsey.cs.laurentian.ca (Andre Roberge)
Message-Id: <9204072013.AA13705@ramsey.cs.laurentian.ca>
To: basiji@milton.u.washington.edu
Subject: Re: How do I make shell prompt show working directory?
Newsgroups: comp.sys.next.misc
Status: R

In comp.sys.next.misc you write:


>The subject pretty much says it all.  I really miss this from my life
>in the DOS world.  How do I modify my .cshrc or .login to make this 
>happen?  

>Thanks,
>Dave
>basiji9@u.washington.edu

Hi there!

You'll probably receive tons of answers on this but
you might want a little addition that I include here...

------------paste in .cshrc-------------
	alias SetPrompt  	'set prompt="[7m$cwd>[0m "'
	alias cd	'cd \!* && SetPrompt'
	alias pushd     'pushd \!* && SetPrompt'
	alias popd     'popd \!* && SetPrompt'
--------------------------------------

Try this!!

Andre Roberge



From ofi!raul@uunet.UU.NET Tue Apr  7 22:39:13 1992
Received: from relay2.UU.NET by milton.u.washington.edu
	(5.65/UW-NDC Revision: 2.22 ) id AA05741; Tue, 7 Apr 92 22:39:11 -0700
Received: from uunet.uu.net (via LOCALHOST.UU.NET) by relay2.UU.NET with SMTP 
	(5.61/UUNET-internet-primary) id AA06376; Wed, 8 Apr 92 01:39:08 -0400
Received: from ofi.UUCP by uunet.uu.net with UUCP/RMAIL
	(queueing-rmail) id 013854.20111; Wed, 8 Apr 1992 01:38:54 EDT
Received: by  ofi  (NeXT-1.0 (From Sendmail 5.52)/NeXT-1.0)
	id AA04824; Tue, 7 Apr 92 14:36:22 EDT
Date: Tue, 7 Apr 92 14:36:22 EDT
From: ofi!raul@uunet.UU.NET (Raul Alvarez)
Message-Id: <9204071836.AA04824@ ofi >
To: basiji@milton.u.washington.edu
Subject: Re: How do I make shell prompt show working directory?
Newsgroups: comp.sys.next.misc
Organization: Office of the Future, Inc., Edgewater, N.J.
Cc: 
Status: R


Create a shell script with this text and call it .promptset:
--------------------------------------------------------------------------------
set host = "`hostname`"
if ("`alias stripe`" == "") then
    alias stripe ""
endif

if ($?term) then
    alias promptset 'set prompt = "${host}:${cwd} (\\!)% "'
else
    alias promptset 'set prompt = "@${host}:${cwd} (\\!)% "'
endif
alias cd 	'cd \!* ; promptset ; stripe'
alias pushd 	'pushd \!* ; promptset ; stripe'
alias popd 	'popd \!* ; promptset ; stripe'
promptset
--------------------------------------------------------------------------------

In your .cshrc add a line like this:
source .promptset
Newsgroups: comp.sys.next.misc