Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 265
  • Last Modified:

changing shell prompt

This is probably a fairly easy question, but how do I change a csh prompt so that it display the current directory (like DOS).  
0
mpenner
Asked:
mpenner
  • 3
  • 2
  • 2
1 Solution
 
elfieCommented:
alias    cd      'cd \!*;set prompt="`pwd`> "'
set prompt="`pwd`> "
0
 
mpennerAuthor Commented:
That isn't going to work with something like pushd.  Isn't there some way to put something in the prompt environment variable to do this?


0
 
elfieCommented:
The alias on is needed to change the prompt when doing a cd.

So if you use pushd, make the same kind of alias for pushd as well, just change 'cd' into 'pushd'




0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
ahoffmannCommented:
NO thers is no way doing this in csh, use tcsh instead.

As elfie said, you have to make aliases for cd, pushd, popd, etc.
but keep in mind that theree are somee dragons to beet, like:
  cd
  cd ~
  cd ~user
  pushd +2
  cd to_a_mount_point
  cd to_a_link

Probably you check following to identify what you realy want to have:
   echo $cwd -- `pwd`; df .

0
 
mpennerAuthor Commented:
So how would I do it is tcsh?


0
 
ahoffmannCommented:
set prompt = '%/ '
see man tcsh for much more examples ;-)
0
 
mpennerAuthor Commented:
Thanks that is exactly what I wanted to find.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now