»
 

Go Back   ResellerRatings Store Ratings > ResellerRatings Forums > Tech Support

Reply
 
LinkBack Thread Tools Display Modes
Old 06-19-2003, 02:21 AM   #1 (permalink)
Registered User
 
storm2k's Avatar
 
Join Date: Oct 2001
Location: NJ
Posts: 3,417
storm2k is on a distinguished road
Send a message via ICQ to storm2k Send a message via AIM to storm2k Send a message via Yahoo to storm2k
making tcsh mimic bash behavior

hey everyone. one of the things i love about the bash shell in linux is how it shows the current directory you're in (for example, if i'm in /home/mero, it shows (computer name) [mero] in the prompt. my shcool's unix system however, uses tcsh for its shell. how can i edit my .cshrc file such that i can customize my prompt even more (right now my .cshrc command for my prompt is merely

Code:
set prompt = "mero@eden: "
thanks

storm2k is offline   Reply With Quote
Old 06-19-2003, 03:00 AM   #2 (permalink)
Registered User
 
lynchmob's Avatar
 
Join Date: Oct 2001
Location: Mid-Atlantic
Posts: 1,361
lynchmob is on a distinguished road
Try this:
Code:
Place the following into the .cshrc or .tcshrc file:

setenv HOST `uname -n`
alias setprompt 'set prompt="$HOST($cwd)%"'
alias cd 'cd \!* && setprompt'
alias pushd 'pushd \!* && setprompt'
alias popd 'popd \!* && setprompt'
setprompt
The resulting prompt would look like this:

      mars:(/export/home/joe)%
Got it from Here
HTH
lynch
__________________
Seldom right,but never in doubt...
lynchmob is offline   Reply With Quote
Old 06-19-2003, 06:35 PM   #3 (permalink)
Registered User
 
pbharris's Avatar
 
Join Date: Oct 2001
Location: Chicago, IL
Posts: 2,403
pbharris is on a distinguished road
Send a message via ICQ to pbharris Send a message via AIM to pbharris Send a message via Yahoo to pbharris
i will post my work one tomarrow.
__________________
I don't use Linux because I hate Windows (which I do) I use Linux because I like it.
play mtrek! telnet://mtrek.com:23
Odds are very good there are several spelling mistakes in this post.
pbharris is offline   Reply With Quote
Old 06-25-2003, 04:13 PM   #4 (permalink)
Registered User
 
pbharris's Avatar
 
Join Date: Oct 2001
Location: Chicago, IL
Posts: 2,403
pbharris is on a distinguished road
Send a message via ICQ to pbharris Send a message via AIM to pbharris Send a message via Yahoo to pbharris
(five days later...)

Code:
[panther2:~]:more .tcshrc
echo didit
set autolist=ambiguous
setenv CLASSPATH /usr/misc/java:/usr/misc/jre-1.3.1/lib:/export/usr1/blackfly4/ftr_tool
#
setenv PATH ${PATH}:$HOME/bin/:/usr/atria/bin:/usr/openwin/bin/:/vobs/atso_tools/build/bin/:/usr/misc/bin/:/vobs/atso_to
ols/compiler/diab/4.3e/SUNS/bin/:/usr/vendor/Maker-5.5.6/bin/:$CLASSPATH
#
set prompt="[%m:%c]:"

source /usr/vendor/env/lsf_5.0.env
#alias
alias ct 'cleartool'
alias xt 'xterm -sb -sl 10000 -n $HOST -fg white -bg black &'
alias rm 'rm'
alias cls 'clear'
alias x 'exit'
alias l '$HOME/bin/ls -p --color'
alias pss 'ps -ef | grep cph013'
alias ll 'ls -l'
alias pwv 'ct pwv'
alias catcs 'ct catcs'
alias edcs 'ct edcs'
alias sv 'ct setview'
alias vdp 'ct diff -graphical -predecessor'
alias sf '/vobs/atso_tools/boot/super'
#alias diff 'ct diff -graphical -predecessor'
#alias vim 'gvim -fg black -bg white'
alias vtree 'ct lsvtree -graphical'
alias d2u 'dos2unix'
alias path 'echo $PATH'
alias netscape '/usr/vendor/Netscape/netscape &'
#end of aliases

setenv JAVABIN /usr/misc/jre-1.3.1/bin
#setenv WINEDITOR /usr/local/bin/gvim
#setenv EDITOR /usr/local/bin/gvim
setenv LPDEST brie
setenv DISPLAY ${REMOTEHOST}:0.0



[panther2:~]:
__________________
I don't use Linux because I hate Windows (which I do) I use Linux because I like it.
play mtrek! telnet://mtrek.com:23
Odds are very good there are several spelling mistakes in this post.

Last edited by pbharris; 06-25-2003 at 06:31 PM.
pbharris is offline   Reply With Quote
Old 06-25-2003, 07:51 PM   #5 (permalink)
Registered User
 
Praetorian's Avatar
 
Join Date: Oct 2001
Location: Yuma, AZ
Posts: 2,484
Praetorian is on a distinguished road
Send a message via ICQ to Praetorian Send a message via AIM to Praetorian Send a message via Yahoo to Praetorian
Just switch shells. I've got an awesome ZSH setup that I could give you. Looks and works better than BASH IMO.
Praetorian is offline   Reply With Quote
Old 06-25-2003, 08:01 PM   #6 (permalink)
Registered User
 
pbharris's Avatar
 
Join Date: Oct 2001
Location: Chicago, IL
Posts: 2,403
pbharris is on a distinguished road
Send a message via ICQ to pbharris Send a message via AIM to pbharris Send a message via Yahoo to pbharris
Quote:
Originally posted by Praetorian
Just switch shells. I've got an awesome ZSH setup that I could give you. Looks and works better than BASH IMO.

Blasphemy!!!
__________________
I don't use Linux because I hate Windows (which I do) I use Linux because I like it.
play mtrek! telnet://mtrek.com:23
Odds are very good there are several spelling mistakes in this post.
pbharris is offline   Reply With Quote
Old 06-26-2003, 01:01 AM   #7 (permalink)
Registered User
 
Praetorian's Avatar
 
Join Date: Oct 2001
Location: Yuma, AZ
Posts: 2,484
Praetorian is on a distinguished road
Send a message via ICQ to Praetorian Send a message via AIM to Praetorian Send a message via Yahoo to Praetorian
ah! Nevermind. My ZSH stuff doesn't work on Linux like it does on FreeBSD. let me hack away at it for a bit and try to get it working 100%.
Praetorian is offline   Reply With Quote
Old 06-27-2003, 09:36 PM   #8 (permalink)
Registered User
 
storm2k's Avatar
 
Join Date: Oct 2001
Location: NJ
Posts: 3,417
storm2k is on a distinguished road
Send a message via ICQ to storm2k Send a message via AIM to storm2k Send a message via Yahoo to storm2k
actually, i don't want to change my linux setup. i actually just wanted to be able to get a director printout for tcsh when i run on my school's shell. pbharris pointed me in the right direction.
storm2k is offline   Reply With Quote
Old 06-27-2003, 09:40 PM   #9 (permalink)
Registered User
 
storm2k's Avatar
 
Join Date: Oct 2001
Location: NJ
Posts: 3,417
storm2k is on a distinguished road
Send a message via ICQ to storm2k Send a message via AIM to storm2k Send a message via Yahoo to storm2k
see, i did it, that %c variable roughly does what i want without me having to do some massive scripting:

storm2k is offline   Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Most Active Discussions

Recent Discussions

All times are GMT -6. The time now is 09:11 PM.