Solved

changing shell prompt

Posted on 1998-12-17
7
257 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: 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 50 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

Independent Software Vendors: 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

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

690 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