🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.misc
Article #753

Re: How do I make shell prompt show working directory?

#753
From: John McCracken
Date: Tue, 07 Apr 1992 07:27
28 lines
1390 bytes
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
Technical Details
Message-ID: <1992Apr7.072725.6379@nextdoor.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!umn.edu!csus.edu!netcomsv!nextdoor!john
References: <basiji.702614445@milton>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!umn.edu!csus.edu!netcomsv!nextdoor!john
From: john@nextdoor.com (John McCracken)
Newsgroups: comp.sys.next.misc
Subject: Re: How do I make shell prompt show working directory?
Message-ID: <1992Apr7.072725.6379@nextdoor.com>
Date: 7 Apr 92 07:27:25 GMT
Article-I.D.: nextdoor.1992Apr7.072725.6379
References: <basiji.702614445@milton>
Sender: john@nextdoor.com
Reply-To: john@nextdoor.com
Organization: Nextdoor Software, San Jose, CA, USA
Lines: 28