bash vs tcsh

The geek forum. PHP, Perl, HTML, hardware questions etc.. it's all in here. Got a techie question? We'll sort you out. Ask your questions or post a link to your own site here!

bash vs tcsh

Postby Straylight » Mon Nov 24, 2003 8:56 pm

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?
[align=center]
Image
Banner above created using my avatar generator tool.
You know you want try it.
User avatar
Straylight
 
Posts: 2346
Joined: Mon May 26, 2003 12:00 pm
Location: Manchester, UK

Postby shooraijin » Tue Nov 25, 2003 4:34 am

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.
"you're a doctor.... and 27 years.... so...doctor + 27 years = HATORI SOHMA" - RoyalWing, when I was 27
"Al hail the forum editting Shooby! His vibes are law!" - Osaka-chan

I could still be champ, but I'd feel bad taking it away from one of the younger guys. - George Foreman
User avatar
shooraijin
 
Posts: 9927
Joined: Thu Jun 26, 2003 12:00 pm
Location: Southern California

Postby Straylight » Tue Nov 25, 2003 3:43 pm

Hmm, I was just curious. Apparently tcsh is a better shell to use in bioinformatics... because it's more programmer friendly.
[align=center]
Image
Banner above created using my avatar generator tool.
You know you want try it.
User avatar
Straylight
 
Posts: 2346
Joined: Mon May 26, 2003 12:00 pm
Location: Manchester, UK

Postby shooraijin » Tue Nov 25, 2003 4:53 pm

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. :)
"you're a doctor.... and 27 years.... so...doctor + 27 years = HATORI SOHMA" - RoyalWing, when I was 27
"Al hail the forum editting Shooby! His vibes are law!" - Osaka-chan

I could still be champ, but I'd feel bad taking it away from one of the younger guys. - George Foreman
User avatar
shooraijin
 
Posts: 9927
Joined: Thu Jun 26, 2003 12:00 pm
Location: Southern California

Postby Mithrandir » Wed Nov 26, 2003 12:52 pm

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.
User avatar
Mithrandir
 
Posts: 11071
Joined: Fri Jun 27, 2003 12:00 pm
Location: You will be baked. And then there will be cake.

Postby shooraijin » Wed Nov 26, 2003 2:22 pm

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
"you're a doctor.... and 27 years.... so...doctor + 27 years = HATORI SOHMA" - RoyalWing, when I was 27
"Al hail the forum editting Shooby! His vibes are law!" - Osaka-chan

I could still be champ, but I'd feel bad taking it away from one of the younger guys. - George Foreman
User avatar
shooraijin
 
Posts: 9927
Joined: Thu Jun 26, 2003 12:00 pm
Location: Southern California

Postby Master Kenzo » Wed Nov 26, 2003 4:14 pm

Bash is *simple*
I'm back to make a post or two every couple years...
User avatar
Master Kenzo
 
Posts: 591
Joined: Thu May 29, 2003 12:38 pm
Location: Ajax

Postby Mithrandir » Wed Nov 26, 2003 4:38 pm

Wow! Control characters are SO much easier than tabs!
User avatar
Mithrandir
 
Posts: 11071
Joined: Fri Jun 27, 2003 12:00 pm
Location: You will be baked. And then there will be cake.

Postby shooraijin » Wed Nov 26, 2003 4:44 pm

Last time I checked, a tab *was* a control character ... just one with a shortcut key. ;)
"you're a doctor.... and 27 years.... so...doctor + 27 years = HATORI SOHMA" - RoyalWing, when I was 27
"Al hail the forum editting Shooby! His vibes are law!" - Osaka-chan

I could still be champ, but I'd feel bad taking it away from one of the younger guys. - George Foreman
User avatar
shooraijin
 
Posts: 9927
Joined: Thu Jun 26, 2003 12:00 pm
Location: Southern California

Postby Mithrandir » Wed Nov 26, 2003 5:08 pm

...and I've seen so many keyboards with a CONTROL-D shortcut key!!!!!
User avatar
Mithrandir
 
Posts: 11071
Joined: Fri Jun 27, 2003 12:00 pm
Location: You will be baked. And then there will be cake.

Postby shooraijin » Wed Nov 26, 2003 5:40 pm

Obviously you've been looking in the wrong places. *arrogant sniff*
"you're a doctor.... and 27 years.... so...doctor + 27 years = HATORI SOHMA" - RoyalWing, when I was 27
"Al hail the forum editting Shooby! His vibes are law!" - Osaka-chan

I could still be champ, but I'd feel bad taking it away from one of the younger guys. - George Foreman
User avatar
shooraijin
 
Posts: 9927
Joined: Thu Jun 26, 2003 12:00 pm
Location: Southern California


Return to Computing and Links

Who is online

Users browsing this forum: No registered users and 128 guests