Slashdot Mirror


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.

15 of 265 comments (clear)

  1. this is a good thing by Dan+Ost · · Score: 5, Interesting

    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...
    1. Re:this is a good thing by FroMan · · Score: 2, Interesting

      Hmmm, as far as simple scripts go, I would agree bourne is the way to go. Like init scripts and such, bourne shell (not bash) is more common and hence a better way to go.

      Once you need something more than a quick script I find perl to be a much better way of doing things.

      However, I find tcsh to be more friendly for when I am using. As one of my general rules I leave root as bash while my acocunt if setup as tcsh. When I am root I go nuts because the redirecting is slightly different and I prefer ^d to get a list of files instead of tab.

      Probably muct of why I prefer tcsh is simpley I have spent more time in it and have setup my environment better for it.

      --
      Norris/Palin 2012
      Fact: We deserve leaders who can kick your ass and field dress your carcass.
  2. As long as it works... whatever... by diverman · · Score: 3, Interesting

    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

  3. This is not a good thing by metamatic · · Score: 4, Interesting

    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
  4. Speaking of shells ... what ever happened to ... by torpor · · Score: 1, Interesting

    ... that shell that had media properties?

    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 ... seems to me that a shell like that would be nice to have under OSX ...

    --
    ; -- the corruption of government starts with its secrets. a truly free people keep no secrets. --
  5. Apparently you missed the point of the article by metamatic · · Score: 3, Interesting

    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
  6. Re:tcsh user by Atzanteol · · Score: 4, Interesting
    And why switch when tcsh works well.
    Because there is no 'trivial' way to do this in tcsh:
    cmd 2>/dev/null
    In tcsh you need to do some kludge like:
    (cmd > /dev/tty ) >& /dev/null
    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
  7. Re:Let's get rid of sendmail too by RalphBNumbers · · Score: 5, Interesting
    I'm glad they don't install emacs. I'd be even happier if they removed sendmail as well.
    They did remove sendmail as well. Or at least it's no longer the default. Panther uses Postfix by default.
    --
    "The worst tyrannies were the ones where a governance required its own logic on every embedded node." - Vernor Vinge
  8. Well I'm disappointed by goombah99 · · Score: 4, Interesting
    I'm one of those folks that prefers tcsh. I like my shell dumbed down a bit since its easier to remember how to use it. I'm a scientist so some times I'm intensively programming but other time I might go away for a year and do non-computer stuff. Its easy to forget stuff when you dont use it all the time.

    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.
  9. But tcsh is nice! by babbage · · Score: 5, Interesting

    But I like working in tcsh!

    • I have my tcsh environment set up to do case-insensitive tab-completion.
      % cd ~/m<TAB>
      Music/ mail/
      % cd ~/mu<TAB>
      % cd ~/Music

      This is a wonderful feature, especially when working on a case-preserving-yet-insensitive filesystem like HFS+.

    • I also have my tcsh shell set up to use a built-in spell checker. If I try to run a command & have a typo, the shell will attempt to fix it for me:
      % greb foo ~/mail/sent-mail

      CORRECT>grep foo ~/mail/sent-mail (y|n|e|a)?

      This one doesn't always save me -- one of my common typos is to repeat the 'd' when changing directory, thus:

      % cdd ~/Desktop/

      CORRECT>dd ~/Desktop/ (y|n|e|a)?

      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 :-)

  10. Re:How diehard tcsh users will respond: by LEgregius · · Score: 2, Interesting

    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.

  11. Fun Stuff for tcsh Users by macserv · · Score: 4, Interesting

    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.

  12. Those Wacky Apple Folks by juntunen · · Score: 4, Interesting

    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...

  13. Re:Let's get rid of sendmail too by vandel405 · · Score: 2, Interesting

    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.

  14. Re:Differences? by stefanlasiewski · · Score: 2, Interesting

    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."