Solved

Change command prompt for csh

Posted on 2010-11-09
3
1,251 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
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 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.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now