[Robert.L.Harris at rnd-consulting.com: Re: [ale] csh prompt?]

Robert L. Harris Robert.L.Harris at rnd-consulting.com
Wed Nov 29 17:42:11 EST 2000




The major porting is the current working Dir.  That way when the
Developers/DBA's etc go to mess with files they can look at the
prompt and know instead of just hoping they're where they think
they are.

Robert

Thus spake David S. Jackson (dsj at sylvester.dsj.net):

> On Wed, Nov 29, 2000 at 02:27:21PM -0700 Robert L. Harris <Robert.L.Harris at rnd-consulting.com> wrote:
> > 
> > 
> > I have a user asking me how to set the prompt in csh.  I'm a ksh person
> > and don't have any csh books around.  How would I set the prompt
> > in csh to something like:
> > 
> > {lastexitcode}:user:pwd> 
> 
> Assuming you don't have tcsh around, you might have to create an
> alias in your user's .cshrc file:
> 
> ***snip***
> if ($?prompt) then
>    alias setprompt 'set prompt = "`hostname -s` $cwd:t % "'
>    setprompt
>    alias cd 'cd \!*;setprompt'
>    alias pushd 'pushd \!*;setprompt'
>    alias popd 'popd \!*;setprompt'
> endif
> ***snip***
> 
> The above just puts the hostname and current working directory in
> the prompt.  But instead of `hostname -s` you could include
> `whoami` or perhaps a shell script to return the rest of the
> prompt you want.  I've never tried putting the last exit code in
> a prompt before.  
> 
> --
> David S. Jackson                        dsj at dsj.net
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Will Rogers never met you.



:wq!
---------------------------------------------------------------------------
Robert L. Harris                |  Micros~1 :  
Senior System Engineer          |    For when quality, reliability 
  at RnD Consulting             |      and security just aren't
                                \_       that important!
DISCLAIMER:
      These are MY OPINIONS ALONE.  I speak for no-one else.
FYI:
 perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);'
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.





More information about the Ale mailing list