![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Linux Shell Question: how to print the shell script name ? | meili100 | UNIX for Dummies Questions & Answers | 3 | 07-01-2008 10:55 AM |
| Difference between writing Unix Shell script and AIX Shell Scripts | haroonec | AIX | 0 | 04-11-2006 11:27 PM |
| How to run unix commands in a new shell inside a shell script? | hkapil | Shell Programming and Scripting | 2 | 01-04-2006 03:56 AM |
| how to convert from korn shell to normal shell with this code? | forevercalz | Shell Programming and Scripting | 21 | 11-22-2005 11:18 PM |
| simple shell - how to get a parameter typed in a shell script | cmitulescu | Shell Programming and Scripting | 3 | 12-05-2001 12:04 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
C shell
Hi,
How do I set the shell prompt to show the current location I am ? I know that in posix, I can do so by appending 'export PS1='$PWD ($LOGNAME)>' ' in my .profile. But how about .cshrc? regards jennifer
__________________
Jennifer Koh Technical supprt Officer / Sys Admin Nanyang Polytechnic 180 Ang Mo Kio Ave 8 Singapore 569830 Electronics Design Centre |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
hi!
'export' is not an internal command of the CSH shell. your .cshrc file should read: set PWD=`pwd` set LOGNAME="$USER" set prompt="$PWD : $LOGNAME> " Rgds SHAIK |
|
#3
|
|||
|
|||
|
C shell Prompt
Hi,
You can also set the prompt with the current user in .cshrc with the 'whoami`command: e.g. set prompt = "`whoami`: `hostname`%" would produce the prompt: currentuser:host% Rgds, Brian |
|
#4
|
|||
|
|||
|
Hi,
this might give you u another solution... set prompt = "`echo $user\:$cwd` >> " Regards, Anent |
|
#5
|
|||
|
|||
|
Hi Jenny,
Had I understood what you want exactly, you can try adding this line in your .cshrc alias cd 'cd \!*;set prompt="`echo $cwd`> ";' Hope this helps! Wish you a Happy New Year |
|||
| Google The UNIX and Linux Forums |