The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
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

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 11-26-2001
Registered User
 

Join Date: Aug 2001
Location: Singapore
Posts: 32
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
Reply With Quote
Forum Sponsor
  #2  
Old 11-27-2001
shaik786
Guest
 

Posts: n/a
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
Reply With Quote
  #3  
Old 12-05-2001
Registered User
 

Join Date: Dec 2001
Location: Dublin
Posts: 44
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
Reply With Quote
  #4  
Old 12-14-2001
Registered User
 

Join Date: Oct 2001
Location: India
Posts: 45
Hi,
this might give you u another solution...

set prompt = "`echo $user\:$cwd` >> "

Regards,
Anent
Reply With Quote
  #5  
Old 01-02-2002
sskb
Guest
 

Posts: n/a
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
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 07:30 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0