3 ms·
Way 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 her
by jleader 15y ago
Way 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.