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.

49 of 265 comments (clear)

  1. But unless bash... by computerme · · Score: 5, Funny

    also does "ogg vorbis" i predict still more complaining....

  2. zsh and BASH? Not me... by squiggleslash · · Score: 3, Insightful
    Now, I'm a pdksh guy. I know it's old, it's not even based on the latest version of "real" KSH, but it does what I need and there's no funny stuff with the back arrow. (bash lets you edit your command history, which 99% of the time you do unintentionally and I've never figured out how to undo the damage.)

    Needless to say, pdksh is available for OS X too but you need to download and install it.

    It's great. Does exactly what I want out of a shell.

    --
    You are not alone. This is not normal. None of this is normal.
    1. Re:zsh and BASH? Not me... by Neon+Spiral+Injector · · Score: 3, Informative

      I think what he was saying is:

      ls /some/big/long/complicated/dir/name[enter]
      [up arrow]
      [backspace]x5
      [down arrow]
      [up arrow]

      The "/name" is still missing. This history has been edited. There is no way to get it back. I like it for when I accidently type my password on the command line, I can go back up and delete it, and it will be gone. I don't like it, when I remove a complicated command and then discover I need it again.

    2. Re:zsh and BASH? Not me... by hymie3 · · Score: 3, Informative

      So you have a situation like this?:

      mkdir /usr/local/gugalwumpus-3.2
      cp /home/you/froombor.tar.gz ___________


      I'd do this: /usr/local/gugalwumpus-3.2
      cp /home/you/froombor.tar.gz !$

      The !$ means "the last part of the last command".
      Other cool "bang" commands are:
      !! - repeat the last command
      !-n - repeat the nth previous command
      !* - all of the arguments to the last command

      So, if you've ever typed "vm stuff /newdir"
      You *could* up arrow, control-A, control-D, control-F v
      or you could type "mv !*"

      Lots of nifty shortcuts. Of course, I use tcsh, so what do I know?

  3. It just fits with Apple's focus on usability by ArmorFiend · · Score: 4, Funny

    This move fits with Apple's focus on usability. To be usable, you have to be pronounceable, and you have to be memorable.

    bash: nice, violent, memorable name
    tcsh: the city in Belorussia?
    Its a no-brainer, really.

  4. Welcome by DevilM · · Score: 5, Funny

    I for one welcome our new bourne again overlords.

  5. Re:*CSH IS DYING by jmelloy · · Score: 3, Informative

    You can get all the software updates from the command line, at least the ones that come through Software Update. The command is "softwareupdate", and needs to be run as root.

  6. Re:*CSH IS DYING by computerme · · Score: 4, Insightful

    you can do updates from the command line...

    as for emacs...

    I found this:

    http://www.porkrind.org/emacs/

    In under three seconds. Geez...

    And btw, It already is REAL unix, and not only is it the highest volume shipping version of unix on the planet, but apple did what NO other software company has been able to do in the 30+ year history of unix. The made it usable by the masses.

    Care to give them at least an ounce of credit now?

  7. Re:One of my biggest girpes about OS X by tha_mink · · Score: 3, Insightful

    Can you not change shells in OSX? If you can_ What's the big deal what the "default" shell is?

    If you can't change shells_ then that's just plain weak.

    --
    You'll have that sometimes...
  8. 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...
  9. Why not something more appealing to non-geeks by kinnell · · Score: 3, Funny

    With their penchant for user friendliness, I'm surprised they didn't choose mudsh

    --
    If I seem short sighted, it is because I stand on the shoulders of midgets
  10. Re:One of my biggest girpes about OS X by computerme · · Score: 5, Insightful

    yes you can. Some people just like to complain. It makes them feel better or something...

  11. Couldnt anyone that really cares... by ErisCalmsme · · Score: 5, Insightful

    just install whatever shell they wanted to use anyway? Im sure anyone that has shell scripting in mind also knows how to install their own shell the correctly right?

    --
    Chaos is Divine *
  12. 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

  13. 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
    1. Re:This is not a good thing by 4of12 · · Score: 3, Insightful

      writing non-trivial scripts

      I read the reasons not to use csh for scripting after I had spent about 10 years or so with csh from BSD days.

      Even though I now run bash for an interactive shell (tcsh would probably be just as good with emacs style command line editing), I'm careful to limit myself to plain Bourne shell for scripts, since those are more portable than anything - I think that's why autoconf is successful.

      The modern languages are good for serious scripting, as a glue language, for projects where you're willing to port the language and any needed libraries to the new platform.

      But for a gopher build script, poking its head up in the dark of an unknown flavo[u]r of UNIX, sh is the True Path.

      --
      "Provided by the management for your protection."
  14. tcsh user by hubertf · · Score: 3, Insightful

    count me in for long-time tcsh users.
    It's not that I'm die-hard fanatic over it, but when I started using Unix there was only tcsh as a comfort shell, no bash. And why switch when tcsh works well.

    - Hubert

    1. 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
  15. I use tcsh as my interactive shell. by molo · · Score: 4, Insightful

    tcsh works perfectly well as an interactive shell. It has some severe problems when it comes to scripting, so I do my scripting in portable bourne shell.. but tcsh is perfectly functional as an interactive shell. I use it under linux, solaris, aix, hpux, and cygwin without issue.

    That said, I'm not surprised that apple change to a bourne-compatible shell. Bourne has been the unix standard for a long time, so changing to this makes sense. It means that all of the unix examples out there will work out of the box and not have to be translated into csh syntax. This is probably a good thing. People can still exec tcsh if they like.

    -molo

    --
    Using your sig line to advertise for friends is lame.
  16. Re:Default shell can be changed, I think by profet · · Score: 5, Informative

    from shell (or just find the double clickable icon):

    open /Applications/Utilities/NetInfo\ Manager.app

    now navigate to users->$userWhosShellYouWantToChange

    find the key named....(this is a tough one) "shell" and then just put the shell you want...bash....whatever...

  17. 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
  18. Re:Let's get rid of sendmail too by mithras+the+prophet · · Score: 3, Informative
    Last login: Tue Aug 26 11:16:41 on ttyp3
    Welcome to Darwin!
    [hostname:~] mithras% whereis emacs
    /usr/bin/emacs
    settles that.
    --
    four nine eighteen twenty-7 thirty-nine forty-7 fiftyeight sixty-nine seventy-9 eighty-8 one-hundred-and-nine one-twenty
  19. Re:*CSH IS DYING by ZackSchil · · Score: 3, Informative
    File Edit Options Buffers Tools Help
    Welcome to GNU Emacs

    Get help C-h (Hold down CTRL and press h)
    Undo changes C-x u Exit Emacs C-x C-c
    Get a tutorial C-h t Use Info to read docs C-h i
    Ordering manuals C-h RET
    Activate menubar F10 or ESC ` or M-`
    (`C-' means use the CTRL key. `M-' means use the Meta (or Alt) key.
    If you have no Meta key, you may instead type ESC followed by the character.)

    GNU Emacs 21.1.1 (powerpc-apple-darwin6.0)
    of 2002-07-27 on law
    Copyright (C) 2001 Free Software Foundation, Inc.

    GNU Emacs comes with ABSOLUTELY NO WARRANTY; type C-h C-w for full details.
    Emacs is Free Software--Free as in Freedom--so you can redistribute copies
    of Emacs and modify it; type C-h C-c to see the conditions.
    Type C-h C-d for information on getting the latest version.
    I know little to nothing about traditional *nix tools, I still crack open BBEdit because that's the way I've done things, well, forever now, but when I type in emacs into the OS X command line I get this. It appears to be GNU Emacs, though a slightly outdated version. I never installed this. I'm the only user of this machine. It think it's included in OS X.
  20. Re:Let's get rid of sendmail too by Anonymous Coward · · Score: 4, Informative
    "I'm glad they don't install emacs. I'd be even happier if they removed sendmail as well."

    This will not happen. sendmail is written by Kirk McKusick's partner, Eric Allman, and Apple are still trying very very VERY hard to recruit Kirk to help with speed and more robust POSIX compliance. Pitching Kirk's life partner's work would not be a convincing way of showing Kirk much they want him on board.

  21. 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
  22. Would someone please tell me... by cryptochrome · · Score: 4, Insightful

    What's so great about bash and/or zsh? Now that I've gotten used to tcsh I'm not sure why it should change. They all seem pretty much the same to me, except the do the same things in slightly different ways.

    If you ask me, the default shell should be whichever one with a history that loads the fastest. Many os x users only use terminal.app for the occasional foray into command-line-only commands (like me). Waiting for your shell to load are precious seconds wasted.

    --

    ---If you can't trust a nerd, who can you trust?

  23. 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.
  24. Groovy! by Alex+Reynolds · · Score: 5, Funny

    For a moment there, I thought the headline read: Apple Switches THC for hash...

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

    1. Re:But tcsh is nice! by phaze3000 · · Score: 3, Insightful
      --
      Blaming GW Bush for the Iraq war is like blaming Ronald McDonald for the poor quality of food.
    2. Re:But tcsh is nice! by profet · · Score: 3, Informative

      I have my bash environment set up to do case-insensitive tab-completion

      to do this in OS X:

      pico ~/.inputrc

      add the following line:

      set completion-ignore-case on

      ctrl-o (CTRL!!!! not command!!!!)

      now restart bash....

    3. Re:But tcsh is nice! by babbage · · Score: 4, Informative

      Or skip the "here's how to use a text editor" steps entirely:

      % echo "set completion-ignore-case on" >> ~/.inputrc

      The file redirection operators are your friend, no matter what shell dialect you prefer. :)

    4. Re:But tcsh is nice! by Van+Halen · · Score: 3, Insightful
      This one doesn't always save me -- one of my common typos is to repeat the 'd' when changing directory, thus:

      % cdd ~/Desktop/

      Do you, by any chance, happen to use an Apple Pro keyboard with your Mac? The one with the black keys? I'm pretty sure this is a quirk of that keyboard because it happens to me all the time, but ONLY on that keyboard. I finally gave up and put alias cdd cd in my .tcshrc.

      On the subject of switching to bash, I've been using tcsh since I started with Unix 11 years ago. I'd be happy to switch, but I need to be able to translate all the 'comfort' features that I've grown accustomed to over the years. Those occasional times when I have to use a bash command-line, I find that it does do most of the features I like about tcsh (tab completion is by far the biggest; autocorrection rocks) but it's usually a bit different (I haven't bothered to read up on how to turn off the beep, which I hate!). Even if bash is so much better than tcsh, I'm still gonna need to have all my settings about the same, or I don't care if it's more powerful! :)

      I may try it for a bit out of laziness when I get Panther, but then I wouldn't be surprised if I switch back to tcsh pretty quickly...

  26. How diehard tcsh users will respond: by ivan256 · · Score: 4, Insightful


    bash-2.04$ chsh /bin/tcsh

    1. Re:How diehard tcsh users will respond: by gabe · · Score: 4, Informative

      gabe@jupiter:~$ chsh /bin/tcsh
      chsh: unknown user: /bin/tcsh

      Well, even if you do just 'chsh' and edit the Shell line, it still doesn't make any changes to netinfo...

      Perhaps you'll want to do this instead:

      niutil -createprop . /users/myusername shell /bin/tcsh

      --
      Gabriel Ricard
  27. Re:*CSH IS DYING by babbage · · Score: 4, Informative
    get emacs in the default install

    Come again?

    % ls -1 /usr/bin/*emacs*
    /usr/bin/emacs
    /usr/bin/emacs-21.1
    /usr/bin/emacsclient

    Funny troll, but emacs is part of the default install.

    Caveat: it's possible that emacs is part of the developer's tools rather than a base OSX installation. I don't think that matters though: if you're looking for a "real Unix", then you're going to want a C compiler and all the rest anyway, so you're going to check off the button for "install BSD subsystem" at system install time and you're going to install the developer's tools immediately after you first log in to the system. So whether Emacs was available 0 minutes or 2 minutes after the first login, I still would call that part of a complete operating system, and saying that it's not available is just trolling.

  28. How will tcsh users react? by jarran · · Score: 5, Funny
    what remains to be seen is how diehard tcsh users will react

    I imagine it will go something along the lines of...

    user@mac:~$ tcsh
    mac:~>

  29. Re:*CSH IS DYING by daeley · · Score: 3, Troll

    Not to nitpick, but one can run softwareupdate as nonroot in order to check for updates, then sudoing it for the actual install.

    --
    I watched C-beams glitter in the dark near the Tannhauser gate.
  30. Re:Let's get rid of sendmail too by allgood2 · · Score: 4, Informative

    Came with the system. I'm in process of setting up a brand new laptop with OS X 10.2.6, and emacs is there. I haven't even installed Developer Tools as of yet, which is where it was before. So sometime, probably in some update from 10.2.3 to 10.2.6 emacs was added to the basic OS.

  31. Now, about "ps" by The+Bum · · Score: 4, Insightful

    This is a mild gripe, but I'd like to see a version of "ps" that follows the Linux conventions for arguments. I work with three *nix operating systems: OS X, Linux, and HP-UX. The arguments are mostly the same between Linux and HP-UX, e.g. "ps -ef" for a listing of all processes. I invariably try typing that same command in OS X, only to remember, after being told that the arguments are invalid, that the equivalent command is "ps -ax". Annoying!

    1. Re:Now, about "ps" by smack.addict · · Score: 3, Informative

      This is a BSD/Sys V difference and a pain that everyone who made the transition from Sunos 4.x to Solaris had to deal with.

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

  33. Re:One of my biggest girpes about OS X by tha_mink · · Score: 3, Funny

    "It's the same mentality that's behind different Islamic sects hating each other even more than they hate Christians."

    Really? How exactly does a default shell in an OS relate to that again?

    Plus if bash comes with it and all you have to do is change default shells, what's the big deal?

    --
    You'll have that sometimes...
  34. 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...

  35. Re:Let's get rid of sendmail too by oZZoZZ · · Score: 3, Funny

    emacs sheemacs, it comes with vi, and that's all that matters

    :wq

  36. Re:Let's get rid of sendmail too by Suppafly · · Score: 4, Funny

    Anyway, Apple has enough problems with OS X being RAM-hungry, without enticing people to fill 80MB with a text editor.


    Agreed, using emacs for a simple text editor is like using MS Office as a simple text editor.. Except MS Office is smaller.

  37. Gives new meaning... by Rorshach · · Score: 3, Funny

    ...to the term mac bash-ing.

    ...or bourne again mac user.

  38. it was a "licensing" issue by fricc · · Score: 3, Insightful

    bash is GPL and zsh is Berkeley, Apple seemed to be afraid of GPL at the beginning and has taken a more practical stance more recently...

  39. Just choose tcsh or bash yourself by Offwhite98 · · Score: 3, Informative

    You can just update your account to use whatever shell you want anyway. I see both bash and tcsh on my MacOS X 10.2 install, so there should be no trouble for someone who cares enough to change shells.

    It is a moot point.

    --
    Brennan Stehling - http://brennan.offwhite.net/blog/