.cshrc

Open discussion on or around SGI; software/hardware related posts should go in the appropriate subforum.
Forum rules
Any posts concerning pirated software or offering to buy/sell/trade commercial software are subject to removal.
User avatar
Hakimoto
Moderator
Moderator
Posts: 2671
Joined: Sun Mar 30, 2003 4:29 am
Location: Nijmegen, Netherlands, Europe
Contact:

.cshrc

Unread postby Hakimoto » Fri Apr 18, 2003 4:30 am

Is this file actually used by all shells? Saying that, if I use bash, will it pull info out of there as well? It appears so on my machine. Is there any good tutorial on how to customise .cshrc? I am a bit lost still in the waves of the shell sea.
The Bandito wrote:In a few years, no doubt, you'll be able to buy a computer,
software and operating system that will match the capabilities
of your current Amiga at about the price you paid for the
Amiga way back when. But you can smile to yourself, knowing
that you were touching the future years before the rest of
the world. And that other computers and operating systems
will do with brute force what the Amiga did years before with
grace, elegance and style.


Eroteme.ch - my end of the internet...

User avatar
nicolas
Posts: 146
Joined: Thu Apr 10, 2003 5:33 pm
Location: Sherbrooke, Quebec, Canada

Unread postby nicolas » Fri Apr 18, 2003 5:51 am

The .cshrc is not used by bash. configuration file for bash are
.bashrc, .bash-profile and .bash-history.

has for a tutorial maybe Man page would be a good start or google.

vegac
Posts: 745
Joined: Thu Jan 23, 2003 11:34 am
Contact:

Unread postby vegac » Fri Apr 18, 2003 8:08 am

Bash is setup a bit differently than csh/tcsh.

I've ALWAYS used bash myself, so I may be able to help...

Your personal startup stuff (what would be in .cshrc in csh) go in either/both .profile, and .bashrc
one's used for "login" shells, other for non-login shells. What exactly the difference is I'll leave for the man page

As for customizing it depends what you want to do...

setting environment variables is as easy as
export VARIABLE="value"

(vs. csh's setenv VARIABLE "value")

If you want I can share my .bashrc with you - sets up the prompt the way I like it (colored and all), sets up ls to use /usr/freeware/bin/ls --color, so I get colored listings, etc.

User avatar
Hakimoto
Moderator
Moderator
Posts: 2671
Joined: Sun Mar 30, 2003 4:29 am
Location: Nijmegen, Netherlands, Europe
Contact:

sharing resources...

Unread postby Hakimoto » Fri Apr 18, 2003 9:46 am

That´d be really nice vegac. I´ve been browsing through the man pages...but it´s so much stuff. Much appreciated.
The Bandito wrote:In a few years, no doubt, you'll be able to buy a computer,
software and operating system that will match the capabilities
of your current Amiga at about the price you paid for the
Amiga way back when. But you can smile to yourself, knowing
that you were touching the future years before the rest of
the world. And that other computers and operating systems
will do with brute force what the Amiga did years before with
grace, elegance and style.


Eroteme.ch - my end of the internet...

vegac
Posts: 745
Joined: Thu Jan 23, 2003 11:34 am
Contact:

Unread postby vegac » Mon Apr 21, 2003 12:21 pm

Well, I don't have access to my SGI right now, but when I get back to California on wednesday I can post it up for you all to peruse :)

User avatar
Hakimoto
Moderator
Moderator
Posts: 2671
Joined: Sun Mar 30, 2003 4:29 am
Location: Nijmegen, Netherlands, Europe
Contact:

Thanks...

Unread postby Hakimoto » Mon Apr 21, 2003 2:40 pm

Cheers vegac, again! I am looking forward to it. (I have completed the quarterly update of my system, installed all the freeware goodies, sorted out some stuff in the filesystem, and the bash book is on the way, so let´s get hacking!)
The Bandito wrote:In a few years, no doubt, you'll be able to buy a computer,
software and operating system that will match the capabilities
of your current Amiga at about the price you paid for the
Amiga way back when. But you can smile to yourself, knowing
that you were touching the future years before the rest of
the world. And that other computers and operating systems
will do with brute force what the Amiga did years before with
grace, elegance and style.


Eroteme.ch - my end of the internet...

karbak
Posts: 38
Joined: Sun Apr 13, 2003 4:46 am
Location: Pittsburgh, PA

Unread postby karbak » Mon Apr 21, 2003 8:42 pm

nicolas wrote:The .cshrc is not used by bash. configuration file for bash are
.bashrc, .bash-profile and .bash-history.

has for a tutorial maybe Man page would be a good start or google.


Canonically speaking, those latter two files should be .bash_profile and .bash_history. From my cursory reading of the bash manual, this is how init files are parsed -

    for an interactive login shell -
    /etc/profile is unconditionally parsed. The first readable file to be found amongst $HOME/.bash_profile, $HOME/.bash_login and $HOME/.profile is then parsed.

    for an interactive non-login shell -
    $HOME/.bashrc is read if available.


In general, most configuration is performed via $HOME/.bashrc, which is sourced by $HOME/.bash_profile.

Hope that helps.

-arun

vegac
Posts: 745
Joined: Thu Jan 23, 2003 11:34 am
Contact:

Unread postby vegac » Sun Apr 27, 2003 7:28 am

The following is my .bashrc file, as promised.

Note, the .bashrc is run for non-login shells, such as starting up a new xterm or aterm inside of an xsession. .profile (or .bash_profile) is run for login shells, such as SSH-ing into a machine. In my profile, I just "include" the .bashrc with the line "source .bashrc" at the end.

---start .bashrc---
#Setup my colorful prompt
COLOR1="\[\033[1;38m\]"
COLOR2="\[\033[1;39m\]"

COLORRED="\[\033[1;31m\]"
COLORBLUE="\[\033[1;34m\]"
COLORCYAN="\[\033[1;36m\]"
COLORPURPLE="\[\033[1;35m\]"
COLORNORMAL="\[\033[0m\]"

if [ "$PS1" ]; then
PS1="($COLORBLUE\u$COLORRED@$COLORBLUE\h$COLORNORMAL)($COLORRED\w$COLORNORMAL)> "
PS2="$COLORBLUEÄÄ$COLORREDÄ "
fi

#Setup LS to use colors - requires a freeware packages
eval `/usr/freeware/bin/dircolors`
alias ls="/usr/freeware/bin/ls --color"

#Add freeware and local/bin to path...
export PATH="$PATH:/usr/freeware/bin:/usr/local/bin"
---end .bashrc---

and there you have it, colorful prompts and a few other goodies - not much though.

User avatar
Hakimoto
Moderator
Moderator
Posts: 2671
Joined: Sun Mar 30, 2003 4:29 am
Location: Nijmegen, Netherlands, Europe
Contact:

Cheers...

Unread postby Hakimoto » Mon Apr 28, 2003 5:23 am

Thanks vegac!
The Bandito wrote:In a few years, no doubt, you'll be able to buy a computer,
software and operating system that will match the capabilities
of your current Amiga at about the price you paid for the
Amiga way back when. But you can smile to yourself, knowing
that you were touching the future years before the rest of
the world. And that other computers and operating systems
will do with brute force what the Amiga did years before with
grace, elegance and style.


Eroteme.ch - my end of the internet...

User avatar
foetz
Moderator
Moderator
Posts: 6669
Joined: Mon Apr 14, 2003 4:34 am
Contact:

Unread postby foetz » Fri May 02, 2003 10:21 pm

nicolas wrote:The .cshrc is not used by bash. configuration file for bash are
.bashrc, .bash-profile and .bash-history.

has for a tutorial maybe Man page would be a good start or google.


hello,

its .bash_profile and .bash_history!
the shell looks in the .bash_profile in your home folder when you log in.
.bash_history is only the history of your last commands and only if it's set in .bash_profile :lol:

but forget bash. it's just a (bad) mixture of ksh and tcsh.
and it mixes the syntax of both => quite bad to learn and bad for pros cause it has no clear schema.
use ksh for scripts and tcsh for interactive use and you're fine :D

User avatar
lisp
Posts: 274
Joined: Wed Feb 05, 2003 5:23 am
Location: England
Contact:

Unread postby lisp » Sat May 03, 2003 1:55 am

foetz wrote:tcsh for interactive use and you're fine :D


You're nuts!

who in their right mind would want to use Totally Cr*p Shell?
--
lisa

User avatar
foetz
Moderator
Moderator
Posts: 6669
Joined: Mon Apr 14, 2003 4:34 am
Contact:

Unread postby foetz » Sat May 03, 2003 7:26 pm

lisp wrote:
foetz wrote:tcsh for interactive use and you're fine :D


You're nuts!

who in their right mind would want to use Totally Cr*p Shell?


no problem.
stay with bash if you want to but anything other than csh and ksh is custom and probably not
very advisable for beginners.
one should learn the correct and straight syntax from both and might then decide in favour of some other shell.

User avatar
Slide
Posts: 114
Joined: Thu Jan 23, 2003 5:10 am
Location: WI, US
Contact:

Unread postby Slide » Wed May 07, 2003 1:52 pm

foetz wrote:no problem.
stay with bash if you want to but anything other than csh and ksh is custom and probably not
very advisable for beginners.
one should learn the correct and straight syntax from both and might then decide in favour of some other shell.


<ahem> You forget /bin/sh, the original Bourne Shell, from which bash (the Bourne Again shell) is derived. /bin/sh is the One True Shell, and unfortunately, neither csh (and it's derivatives) nor ksh can be considered 'non-custom.' For most practical purposes, it is this humble admins opinion that all shell scripting should be done using pure bourne shell when possible, and only defering to ksh when (and if) necessary. Bash implements many things /bin/sh does not, so making sure to keep it pure is vital, but it seems the masses of Linux zealots have forgotten this, and actually replaced /bin/sh WITH bash, which has resulted in much broken "pure bourne code."

Do keep in mind that ksh is proprietary, and any freely available implementation of ksh is actually a re-implementation of the original ksh and not directly derived from it's code.

csh and friends might make decent user shells, but are extremely brain damaged (not that this prevents me from using tcsh as my shell on my IRIX box; but anywhere else I go it's bash all the way). File descriptors? Whacked. IO pipes and redirection? Whacked. Alias expansion? Whacked. Globbing, signal handling, quoting, expressions...I can go on forever.

Read this: http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/

'tis a holy war, so take it the above link (as well as my rant) with a grain of your preferred seasoning.. ;)

User avatar
foetz
Moderator
Moderator
Posts: 6669
Joined: Mon Apr 14, 2003 4:34 am
Contact:

Unread postby foetz » Thu May 08, 2003 4:51 am

Slide wrote:
foetz wrote:no problem.
stay with bash if you want to but anything other than csh and ksh is custom and probably not
very advisable for beginners.
one should learn the correct and straight syntax from both and might then decide in favour of some other shell.


<ahem> You forget /bin/sh, the original Bourne Shell, from which bash (the Bourne Again shell) is derived. /bin/sh is the One True Shell, and unfortunately, neither csh (and it's derivatives) nor ksh can be considered 'non-custom.' For most practical purposes, it is this humble admins opinion that all shell scripting should be done using pure bourne shell when possible, and only defering to ksh when (and if) necessary. Bash implements many things /bin/sh does not, so making sure to keep it pure is vital, but it seems the masses of Linux zealots have forgotten this, and actually replaced /bin/sh WITH bash, which has resulted in much broken "pure bourne code."

Do keep in mind that ksh is proprietary, and any freely available implementation of ksh is actually a re-implementation of the original ksh and not directly derived from it's code.

csh and friends might make decent user shells, but are extremely brain damaged (not that this prevents me from using tcsh as my shell on my IRIX box; but anywhere else I go it's bash all the way). File descriptors? Whacked. IO pipes and redirection? Whacked. Alias expansion? Whacked. Globbing, signal handling, quoting, expressions...I can go on forever.

Read this: http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/

'tis a holy war, so take it the above link (as well as my rant) with a grain of your preferred seasoning.. ;)



sure, you're right.
sh is THE shell but even in irix sh is not the original sh but a link to ksh88.
if you want the original sh in irix you have to use bsh.

i also extremely agree with you regarding the linux zealots and bash :wink:

however, if one wanna go with the real unices csh and ksh are the primary choice...

User avatar
Slide
Posts: 114
Joined: Thu Jan 23, 2003 5:10 am
Location: WI, US
Contact:

Unread postby Slide » Thu May 08, 2003 5:24 am

foetz wrote:
sure, you're right.
sh is THE shell but even in irix sh is not the original sh but a link to ksh88.
if you want the original sh in irix you have to use bsh.

i also extremely agree with you regarding the linux zealots and bash :wink:

however, if one wanna go with the real unices csh and ksh are the primary choice...


And so it is! /bin/sh -> ../../sbin/sh ; man sh -- "Note: As of IRIX 6.4, sh is the Korn shell rather than the Bourne shell."

That strikes me as being somewhat brain damaged, in the same sense that Linux distros decided that bash would make a better replacement for sh...<sigh>

I'm still inclined to disagree about the primary choices on real unices being csh and ksh; most of the systems I have the pleasure of adminning (Solaris, *BSD, and an old Tru64 box) all have legitimate bourne shells as /bin/sh. A little research and googling shows that I'm apparently quite in the minority, though, as it appears the rest of the thinking world has decided that bourne/korn are nearly interchangeable and that Korn is the Right Answer[tm] (So long as it's not pd-korn). Maybe my Bourne-addiction is just my linux roots showing through...? ;)


Return to “SGI: Discussion”

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest