Apple Switches tcsh for bash
gklinger writes "AppleInsider is reporting that Apple has switched from tcsh to bash in the the latest developer build (7B44) of Mac OS X 10.3 (Panther). There is speculation that the switch was made to appeal to Linux users. Experienced users get pretty religious about their shells so what remains to be seen is how diehard tcsh users will react." I don't know about appealing to Linux users in particular, but I just don't know many people who prefers tcsh these days, on any platform. It seems like everyone is using bash or zsh.
I was a big fan of tcsh until I started doing serious shell scripting in
a heterogeneous environment. Since tcsh wasn't available on all machines, all
shell scripts were written for the bourne shell. After several months of
using bourne shell syntax for scripts but using tcsh shell syntax on the
command line, I finally decided that in order to preserve my sanity, I'd try
bash on the command line. Turns out that after a day or so to get used to
things, bash had everything I used tcsh for plus a couple of features that
I'd never known would be so useful.
I don't like running scripts under bash because it's so big, but as an
environment, it's pretty decent.
*sigh* back to work...
I was used to bash as well, and still use it as my default on my work accounts. However, I allowed myself to get used to tcsh, AND Apple's configurations for it (eventually disabled by default in 10.2, I think). Once I got used to how they configured tcsh, I was rather content to use it. When they removed the configurations that made tcsh behave as it did in earlier versions of OS X, I was annoyed, and immediate found out how to turn those back on.
So, as long as they offer an option with some nice configurations with bash, then I'm all for it. And I DON'T want to have to configure it myself. I simply don't have the time or patience. IF tcsh actually goes away, they better port the enhancements to bash... that's all I gotta say.
-Alex
If you're writing non-trivial scripts, you would do far better to use a decent scripting language like Ruby, Perl or Python, all of which are more portable than bash, not to mention more robust and less likely to result in scripts filled with security holes.
The bash shell is really the tool of choice for people who can only deal with one tool. For interactive use, tcsh is better, and for scripting almost anything is better.
Basically, bash tries to be jack-of-all-trades, with all that that implies. But to FSF folks, who use emacs, "jack of all trades" is a way of life.
GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
... that shell that had media properties?
... seems to me that a shell like that would be nice to have under OSX ...
I seem to recall - circa 1995'ish, I guess - that there was a shell around which could do embedded media - so you could say 'cat something.jpg' and it would display the jpeg to the screen, in the scroll buffer, just like it were an inline image.
Anyone remember that shell project? I've searched freshmeat but I can't find it
; -- the corruption of government starts with its secrets. a truly free people keep no secrets. --
Tom Christiansen's article is explaining why csh shouldn't be used for PROGRAMMING.
Nobody's suggesting that tsch be used for programming. Least of all Apple, who don't provide any kind of development documentation for it beyond the man page. Scripting on the Mac is best done in AppleScript. Scripting on UNIX is best done with Python, Perl or Ruby.
You can run any shell's scripts from your choice of shell, and anyone writing shell scripts more than a couple of dozen lines long ought to be taken out and shot anyway, so there's absolutely no reason to pick your interactive shell based on its scripting capabilities. That's like picking your web browser based on how well it does "display source of page".
Fact is, tcsh is a better interactive shell than bash for newbies, thanks to intelligent command completion. (No, I don't mean the "complete the program name" stuff bash has, I mean the way tcsh knows about common arguments and options of the most-used programs, and can fill those in for you as well.)
GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
In tcsh you need to do some kludge like:
The fact that you cannot redirect stderr independently of stdout has always pissed me off about *csh. I'd rather ksh or bash anyday. Actually, I like bash for my command line, and coding in ksh...
"Ignorance more frequently begets confidence than does knowledge"
- Charles Darwin
"The worst tyrannies were the ones where a governance required its own logic on every embedded node." - Vernor Vinge
tcsh is a tad easier to work with. yes its less powerful but most of the time i dont need the power and would gladly trade for the simpler syntax and even more gladly trade uniformity for customization.
it seem to me that making the default shell tcsh and letting power users change it to bash if they want might bave been a better alternative. also considering that all my scripts will now break under the defaults its not so good for me.
Some drink at the fountain of knowledge. Others just gargle.
But I like working in tcsh!
This is a wonderful feature, especially when working on a case-preserving-yet-insensitive filesystem like HFS+.
This one doesn't always save me -- one of my common typos is to repeat the 'd' when changing directory, thus:
But it's enough of a win that I wouldn't want to go back to an interactive shell that doesn't have such a feature.
Whenever I'm trying to do anything complex, I tend to drop into a bash subshell, but for 90% of interactive work I find that tcsh can do about everything bash can, and has a lot of interesting enhancements that AFAIK bash doesn't. Please feel free to correct me if that's not true, and bash can now do such things.
(Also, another nice thing about being comfortable in an alternative shell, aside from being able to work productively when dropped on a machine that maybe doesn't have a wide variety of shells, is the built in security factor. It has been long observed that using an unusual keyboard or pointing device is an excellent (if mild) way to discourage people from messing around with your computer when you're away from your desk. Using an unusual command shell can have the same mild deterrance effect: it may not keep your Linux-loving neighbor from messing around in a login session you forgot to close, but it might annoy him enough to get it to get bored & go away pretty quickly :-)
DO NOT LEAVE IT IS NOT REAL
I'm afraid chsh doesn't work on OSX. It seems to act like it will as it looks up the info correctly and shows it in vi, but changing the data doesn't change it in netinfo, which in the official copy. Maybe they fixed that in Panther. Anyone tried it? Some earlier posts explain how to change the shell in netinfo.
This isn't well known, and for those who aren't hopelessly devoted to their shell, it's a good reason to use tcsh on Mac OS X. Fred Sanchez maintains a nice set of tcsh configuration files that are installed, but not loaded, by default. For more information, see the file located at:
/usr/share/tcsh/examples/README
If you're a new tcsh user, setting this up is as simple as echoing a few files into your home directory. If you've already got a tcsh configuration, it shouldn't be too hard to shift things around. When all is done, you'll have a great set of default command completions and aliases, and a cool way to organize your customizations.
I followed the link provided, and found the section titled "Unix-lover Heaven" rather funny. It said, "Panther will include a final X11 window server for Unix-based apps, improved NFS/UFS, FreeBSD 5 innovations as well as support for popular Linux APIs, IPv6 and other important acronyms." I'm guessing the marketing folks wrote that last bit...
There is a sendmail binary that isn't send mail, its a simlink(?) to another email client.
I can't remember if it is a sim link, or an actual binary that just converts the command line args to what is expected by the other email server... i'm not on my mac now.
But either way, there is something there called sendmail, that isn't sendmail for compatibility reasons.
The shells all contain a variety of shortcut commands to make life simpler. They each contain a mini-programming language (shell scripts) to help you create your own shortcuts and automate tasks.
If you do alot of work in a terminal, then your choice of shell can be very important.
If you do alot of work via a terminal, then switching from one shell to another can be a pain and usually requires a learning curve. Imagine if your main Mac computer was replaced with a Windows machine, and now you had to learn dozens of new tricks to get the computer to work the way you want it too.
I've been using zsh for years (ksh & sh for scripting). With these tools, I could take a task that required dozens of different commands and wrap everything up in a single program which ran automaticall. Simpler, less errors, less typing.
Now I just got a job where the default shell is csh, which is a pain to work with. It's much, much harder to simplify the commands with this shell.
"Can of worms? The can is open... the worms are everywhere."