5 ms·
I'm waiting for all the Java-bashing Rubyists out there to discover csh. If you need to do "real programming" csh is pretty great and has a more "programmery" s
by bitops 15y ago
I'm waiting for all the Java-bashing Rubyists out there to discover csh. If you need to do "real programming" csh is pretty great and has a more "programmery" syntax than a lot of the others.
But, YMMV.
- jleader 15y agoWay back when I was young and first learning shell scripting, I was taught not to use csh for scripting. Is that no longer true? Have the problems described here http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/ http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/ been fixed in newer versions of csh, or in tcsh?
- bitops 15y agoOkay, I'll take the bait. When I ssh into our Solaris server, it drops me into csh by default. That makes me think someone out there believes it's good enough.
- artsrc 15y agoThat article is focused on writing scripts, rather than interactive use.
- zdw 15y agoThat's not the default (/bin/sh is on recent versions of Solaris, which is fairly primitive), so your sysadmin is probably the person who thinks it's "good enough". Nearly all Solaris systems I've worked on and set up have a sun freeware or CSW system set up on them with all the standard "linuxy" tools installed, so the change isn't that weird.
- bitops 15y agoThis was on a Sun Fire X4500 box set up by a sysadmin who I know for sure is not a csh guy. Could be that it was different for some reason.
- LukeShu 15y agoSolaris is more BSD based than AT&T-UNIX based; csh is the historic choice for BSD, and most BSD-descendants honor this, as it is what BSD users expect. For example, it is the default user shell on FreeBSD. But the system shell is a Bourne-like shell (ash, I believe?). So for serious usage, even the modern BSDs defer to a Bourne shell.
- LukeShu 15y agoI'm not sure about tcsh, but csh still has (at least most) of these issues. The quoting is extremely braindead, to a degree barely suggested in that article.
- mturmon 15y agoWhat you learned is still true. Most of the outright bugs in the article you reference have been fixed. But the design problems are still there in both csh and tcsh. In particular, the problems with manipulating file descriptors to separate stdout from stderr are still there, the signal catching is not as clean as sh/bash, and csh/tcsh quoting is a mess compared to sh/bash. I know of no good reason to prefer csh/tcsh.
- LukeShu 15y agoThat is the opposite of true. csh does indeed have a more "programmery" syntax (it was designed to have a more C-like syntax), but for actual programming it is far less useful for actual scripting due to inconsistencies in the syntax, braindead quoting, half-assed IO redirection, and a number of other issues. There's a "Csh Programming Considered Harmful" article that jleader already linked to. Csh may feel more programmery, but if you do actual programming use a Bourne shell (or Plan 9's rc).
- icebraining 15y ago"When I started doing this stuff with Unix, I wasn't a very good programmer." -- Bill Joy about csh