• 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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