[comp.unix.questions] PROMPT

shahryar@sutro.sfsu.edu (Shahryar G. Hashemi) (10/25/89)

Hello there,

I have a question about setting up my prompt in UNIX.  In DOS you can a:
PROMPT $P$G
and it will automaticaly change my prompt when I change to a new directory.

I would like to know how to do this same command in UNIX.  I have tried 
alias {but no good man pages}.  Could someone out there please help me.

Shahryar Ghazneini Hashemi

<shahryar@sutro.sfsu.edu>

sun@me.utoronto.ca (Andy Sun Anu-guest) (10/25/89)

In article <21262@adm.BRL.MIL> shahryar@sutro.sfsu.edu (Shahryar G. Hashemi) writes:
>Hello there,
>
>I have a question about setting up my prompt in UNIX.  In DOS you can a:
>PROMPT $P$G
>and it will automaticaly change my prompt when I change to a new directory.
>
>I would like to know how to do this same command in UNIX.  I have tried 
>alias {but no good man pages}.  Could someone out there please help me.
>
>Shahryar Ghazneini Hashemi
>
><shahryar@sutro.sfsu.edu>

Add this alias entry to your .login or .cshrc:

	alias cd 'cd \!*; set prompt=$cwd"% "'

I think it will do what you want.

Andy
-- 

_______________________________________________________________________________
Andy Sun                        | Internet: sun@me.utoronto.ca
University of Toronto, Canada   | UUCP    : csri.toronto.edu!me.utoronto.ca!sun
Dept. of Mechanical Engineering | BITNET  : sun@me.utoronto.BITNET

matthew@sunpix.UUCP ( Sun Visualization Products) (10/26/89)

In article <21262@adm.BRL.MIL> shahryar@sutro.sfsu.edu (Shahryar G. Hashemi) writes:
|Hello there,
|
|I have a question about setting up my prompt in UNIX.  In DOS you can a:
|PROMPT $P$G
|and it will automaticaly change my prompt when I change to a new directory.
|
|I would like to know how to do this same command in UNIX.  I have tried 
|alias {but no good man pages}.  Could someone out there please help me.
|
|Shahryar Ghazneini Hashemi
|
|<shahryar@sutro.sfsu.edu>


Since you mention 'aliases' I'm assuming your working in csh.  (I different between
the shell on how to set the prompt.

Your write about using alias.  Try this (its off the cuff, but should work):

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


-- 
Matthew Lee Stier                            |
Sun Microsystems ---  RTP, NC  27709-3447    |     "Wisconsin   Escapee"
uucp:  sun!mstier or mcnc!rti!sunpix!matthew |
phone: (919) 469-8300 fax: (919) 460-8355    |

caren@idca.tds.PHILIPS.nl (Caren Alink) (10/26/89)

In article <21262@adm.BRL.MIL> shahryar@sutro.sfsu.edu (Shahryar G. Hashemi) writes:
>I have a question about setting up my prompt in UNIX.  In DOS you can a:
>PROMPT $P$G
>and it will automaticaly change my prompt when I change to a new directory.
>
>I would like to know how to do this same command in UNIX.  I have tried 
>alias {but no good man pages}.  Could someone out there please help me.

Try putting:

PS1='"$PWD" > '

in your .profile file.