Hacker News new | past | comments | ask | show | jobs | submit login

Probably just a historical artifact; it's common at places with long Unix histories.

The first UNIX machine that I used (circa 1985-1986) had one shell: /bin/sh. No command history, no anything. If you made a typo you had to re-type the whole line, being more careful this time (of course this is before we had graphical terminals with cut&paste) In fact, it was a common habit that if you were going to run a complicated command you'd write a one-off shell script, just so you could edit it if it didn't work.

After some months we managed to get a copy of /bin/csh, and it was a godsend. Now we had a history buffer.. you couldn't do anything "modern" like editing the command line with arrow keys (and certainly no tab-completion yet; some later versions of csh supported completion using the escape key however) However you had things like "!!", "!$", "^foo^bar" for at least modifying the last command run. All of these csh-isms later appeared in bash, btw.

csh was simply such a huge improvement for interactive use you could hardly not use it. The only downside was that it had its own incompatible scripting language which was supposed to be more C-like but actually was just fairly busted. Worse, this was before "#!/bin/sh" was understood by the kernel so scripts just broke: for some reason anything that started with a comment, csh would decide to run itself and fail. However there was a hack where if you started the script with a line that just had ":" it would pass it to /bin/sh instead. So we updated all our scripts and life was good.

A few years later when tcsh was getting popular, migrating to it was natural. You could keep your existing .cshrc/.login files and get all of the modern tab-competing, line-editing goodness. There was a time in the 1990s when just about everybody seemed to be running tcsh except for a handful of ksh fans.

Once you're on tcsh the motivation to move to bash is smaller.. after all, most things work OK. Personally I only converted about 5 years ago: I got sick of having to install tcsh on new machines so I sat down and rewrote my 800-line .cshrc that I'd accumulated over 20 years.

I'm glad I did though. There are often times when I just want to write a short script on the command line (something a simple as "for x in a b c; do blah; done") but I could never remember the csh syntax. So I was always dropping from csh to sh to run them or even doing "sh -c '...'" It's much nicer just being able to type that at my shell prompt.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: