Page 1 of 1

bash vs tcsh

PostPosted: Mon Nov 24, 2003 8:56 pm
by Straylight
The course I'm on teaches the use of tcsh, however I've notices that a large number of linux distros use bash by default. What's the difference?

PostPosted: Tue Nov 25, 2003 4:34 am
by shooraijin
You know, I've never sat down and worked out the sum of all differences, but I'm a tcsh-er of long standing since I grew up in the University of California and everything on BSD/386 was /bin/csh, so when I graduated and ran my own systems, I switched to tcsh.

Mac OS X Panther just switched the default to bash, also.

Near as I can determine from the times I've been forced to use it, bash has csh job control, but no csh scripting or shell-builtins (which is what drives me wild) -- you use ksh or sh syntax for those. I'm pretty sure it has the same features as modern tcsh including filec, history and vikeys, but I don't know how to turn them on and I don't care ;)

The shells are equivalently functional as far as I know, it's just what you're used to. If you have a csh background, you'll prefer tcsh; if you have a ksh or (shiver) sh background, you'll want bash.

PostPosted: Tue Nov 25, 2003 3:43 pm
by Straylight
Hmm, I was just curious. Apparently tcsh is a better shell to use in bioinformatics... because it's more programmer friendly.

PostPosted: Tue Nov 25, 2003 4:53 pm
by shooraijin
There was a blurb someone wrote on why csh shell scripting sucks compared to (k)sh, which seems amusing in light of your comment :)

Myself, I've always preferred csh derivatives, and the first thing I install on any new Unix system I'm building is tcsh sources and a compiler, but I know many people equally rabidly pro-bash, which I ... well ... bash. :)

PostPosted: Wed Nov 26, 2003 12:52 pm
by Mithrandir
Watch it there bucko. Bash has some very handy features. With bash, pressing tab twice will bring up an autocomplete list of whatever matches what you are currently typing. The default behaviour for tcsh (at least on OSX) is to autocomplete, but only if you know the file name. If two or more files match, it won't do anything but sit there and blink at you. Bash is scriptable, it's just a question of what you want to do with it. I personally use perl for just about everything. It's easier to only learn one language.

PostPosted: Wed Nov 26, 2003 2:22 pm
by shooraijin
tcsh does that too. Just type CTRL-D after typing a command:

% ls ^D
file1
file2
file3
file4
thing1
thing2

% ls thing^D
thing1
thing2

PostPosted: Wed Nov 26, 2003 4:14 pm
by Master Kenzo
Bash is *simple*

PostPosted: Wed Nov 26, 2003 4:38 pm
by Mithrandir
Wow! Control characters are SO much easier than tabs!

PostPosted: Wed Nov 26, 2003 4:44 pm
by shooraijin
Last time I checked, a tab *was* a control character ... just one with a shortcut key. ;)

PostPosted: Wed Nov 26, 2003 5:08 pm
by Mithrandir
...and I've seen so many keyboards with a CONTROL-D shortcut key!!!!!

PostPosted: Wed Nov 26, 2003 5:40 pm
by shooraijin
Obviously you've been looking in the wrong places. *arrogant sniff*