[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

changing shell prompt

Posted on 1998-12-17
7
Medium Priority
?
263 Views
Last Modified: 2010-11-01
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
Comment
Question by:mpenner
  • 3
  • 2
  • 2
7 Comments
 
LVL 3

Expert Comment

by:elfie
ID: 2008447
alias    cd      'cd \!*;set prompt="`pwd`> "'
set prompt="`pwd`> "
0
 

Author Comment

by:mpenner
ID: 2008448
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
 
LVL 3

Expert Comment

by:elfie
ID: 2008449
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 51

Accepted Solution

by:
ahoffmann earned 200 total points
ID: 2008450
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
 

Author Comment

by:mpenner
ID: 2008451
So how would I do it is tcsh?


0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 2008452
set prompt = '%/ '
see man tcsh for much more examples ;-)
0
 

Author Comment

by:mpenner
ID: 2008453
Thanks that is exactly what I wanted to find.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question