Solved

Change command prompt for csh

Posted on 2010-11-09
3
1,285 Views
Last Modified: 2012-05-10
I'm attempting to set the user enviroment that will allow the user to see the current working directory while working in a terminal window.  When I do the following in the users .cshrc file I only get the current working directory but the command prompt doesn't change when I change directories.

set prompt="`hostname` {`pwd`}% "

Your assistance is appreciated
0
Comment
Question by:infamous
[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
  • 2
3 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 250 total points
ID: 34096748
Hi,

in csh you must use an alias.
You could put this into your .cshrc file:

alias myprompt 'set prompt="`hostname` {`` pwd`}% "'
# set the prompt initially
            myprompt
            alias cd 'chdir \!* && myprompt'

wmp

0
 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 250 total points
ID: 34096803
Sorry, copy and paste error. Wrong extra backtick!

alias myprompt 'set prompt="`hostname` {`pwd`}% "'
...
0
 

Author Comment

by:infamous
ID: 34096831
Thanks for the quick response.  I will try this in the morning because I'm off to a meeting.  I will post back in the morning.  If I'm able to get back to the office I will respond tonight.  Thanks Again
0

Featured Post

Industry Leaders: 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

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
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 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…

717 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