Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
OS X Businesses Operating Systems Software Unix Apple

Apple Switches tcsh for bash 265

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.
This discussion has been archived. No new comments can be posted.

Apple Switches tcsh for bash

Comments Filter:
  • by computerme ( 655703 ) on Tuesday August 26, 2003 @10:47AM (#6793752)
    also does "ogg vorbis" i predict still more complaining....
  • Comment removed (Score:4, Insightful)

    by account_deleted ( 4530225 ) on Tuesday August 26, 2003 @10:49AM (#6793774)
    Comment removed based on user account deletion
    • (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.)

      What, you've never made a typeo on a command line and needed to fix it? /me bows down!

      AFAIK up-arrow recalls previous commands in last-to-first order. If you accept such a command, its appended onto the end of your list. Thus with history:

      ls
      mkdir /foo
      mkdir /bar
      triple-up-arrow => ls [return]

      your new history should be:
      ls
      mkdir /foo
      mkdir /bar
      ls

      • by Neon Spiral Injector ( 21234 ) * on Tuesday August 26, 2003 @11:08AM (#6794058)
        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.
        • Ah, I understand now.
          There is a way to get it back - clear your line and press return. Now when you press up-arrow the unedited line, with "name" on the end, is still there.
    • But even ignoring how wonderful zsh is, it's effectively an extension of ksh, and even has a compatibility mode for behaving substantially like ksh. It's open source, it's supplied with Mac OS X (and other systems too, I believe), it can do anything you want it to, and it even has a cool name! What more could you want (apart from zealots like me promoting it)?!
  • by ArmorFiend ( 151674 ) on Tuesday August 26, 2003 @10:51AM (#6793800) Homepage Journal
    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.
  • Welcome (Score:5, Funny)

    by DevilM ( 191311 ) <devilm@@@devilm...com> on Tuesday August 26, 2003 @10:51AM (#6793804) Homepage
    I for one welcome our new bourne again overlords.
  • this is a good thing (Score:5, Interesting)

    by Dan Ost ( 415913 ) on Tuesday August 26, 2003 @10:53AM (#6793832)
    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.
    • by metamatic ( 202216 ) on Tuesday August 26, 2003 @11:01AM (#6793959) Homepage Journal
      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.
      • by 4of12 ( 97621 ) on Tuesday August 26, 2003 @11:21AM (#6794241) Homepage Journal

        writing non-trivial scripts

        I read the reasons not to use csh for scripting [faqs.org] 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.

        • I'll second that -- I *always* use #!/bin/sh for scripting (and I *mean* sh, not bash in sh mode).

          For interactivity -- tcsh is what I use on my FreeBSD box, bash is on Cygwin, the same on a few Linux boxen. I do prefer tcsh for interactive use -- it just feels better than bash for me. This is entirely subjective -- you may like ash, zsh or perl for that matter!
      • I agree with you that for non-trivial scripts, Ruby, Perl, or Python
        (my preference is Python) are better choices, but they are not always
        available. In my case, we were writing scripts to automate machine
        installation and weren't guaranteed to have more powerful tools
        available to us on every platform.

        Just because one tool is generally better doesn't mean it is appropriate
        in every circumstance.
    • by FroMan ( 111520 )
      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 g
    • I agree it is a good thing. Doing development and testing on a number of hosts I have had to bounce back and forth between machines running Solaris, Linux, and MacOS X, and on these various machines (a dozen) I never used each account often enough to customize it. I was always banging my head against the desk over such basics as how to set an environment variable. I had finally pretty much gotten used to bash before hitting MacOS X. Yes, I know I could still use bash, but again I'm working on a half-dozen m
  • by kinnell ( 607819 ) on Tuesday August 26, 2003 @10:55AM (#6793852)
    With their penchant for user friendliness, I'm surprised they didn't choose mudsh [xirium.com]
  • by rylin ( 688457 )
    Am I missing something here?
    Surely the aforementioned experienced users would know how to switch shells?
    • That would mean Mac OS X is configurable. Everybody likes to complain about how Apple sets everything up for you. Now the geek *nix guys can say "Damn you apple for making bash my default shell!" You've saved me a step in my configuration!!!
  • by ErisCalmsme ( 212887 ) on Tuesday August 26, 2003 @10:57AM (#6793887) Homepage Journal
    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?
  • by diverman ( 55324 ) on Tuesday August 26, 2003 @10:58AM (#6793912)
    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
  • I'm pretty sure the default shell that opens in Terminal can be changed. But I don't know how it's done. Does anybody?
  • tcsh user (Score:4, Insightful)

    by hubertf ( 124995 ) on Tuesday August 26, 2003 @11:04AM (#6794014) Homepage Journal
    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
    • Re:tcsh user (Score:5, Interesting)

      by Atzanteol ( 99067 ) on Tuesday August 26, 2003 @11:15AM (#6794158) Homepage
      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...
  • by molo ( 94384 ) on Tuesday August 26, 2003 @11:06AM (#6794036) Journal
    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
    • > 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.

      Well, OSX has included bash for a long time, so people could always run their bourne scripts. Now it's just default.
      • Well, OSX has included bash for a long time, so people could always run their bourne scripts. Now it's just default.

        I was talking about the interactive shell. I imagine MacOS X users have been confused when they see instrucitons saying that they should type "export PATH=foo" and it doesn't work in their tcsh shell.

        -molo
  • by cryptochrome ( 303529 ) on Tuesday August 26, 2003 @11:23AM (#6794259) Journal
    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.
  • by goombah99 ( 560566 ) on Tuesday August 26, 2003 @11:24AM (#6794267)
    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.

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

      How is this different than making bash the default and letting power users choose tcsh or whatever else? Hell, you don't even need to be a power user if you like Terminal.app. Go to Preferences and change it.
    • This is just how it will ship. Open it the first time, Preferences menu, default shell /bin/tcsh and you are back where you were before.
    • also considering that all my scripts will now break under the defaults its not so good for me.

      I don't think that'll be an issue. Just because bash is the default doesn't mean your tcsh scripts will no longer be usable. Why? Because in all likelihood, tcsh will still be there. Right now, tcsh is the default, but Apple also includes bash, ksh, zsh, etc. Most likely tcsh will still be available on the system. All this means is out-of-the-box Panther installs will have bash as the default shell.

      As long as y

  • Groovy! (Score:5, Funny)

    by Alex Reynolds ( 102024 ) * on Tuesday August 26, 2003 @11:24AM (#6794272) Homepage
    For a moment there, I thought the headline read: Apple Switches THC for hash...
  • But tcsh is nice! (Score:5, Interesting)

    by babbage ( 61057 ) <cdeversNO@SPAMcis.usouthal.edu> on Tuesday August 26, 2003 @11:30AM (#6794345) Homepage Journal

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

    • by phaze3000 ( 204500 ) on Tuesday August 26, 2003 @11:58AM (#6794716) Homepage
      You can do this with bash too.

      http://www.caliban.org/bash/index.shtml#completion [caliban.org]

    • Re:But tcsh is nice! (Score:3, Informative)

      by profet ( 263203 )
      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....

      • Re:But tcsh is nice! (Score:5, Informative)

        by babbage ( 61057 ) <cdeversNO@SPAMcis.usouthal.edu> on Tuesday August 26, 2003 @01:10PM (#6795612) Homepage Journal

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

    • by Van Halen ( 31671 )
      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

  • by ivan256 ( 17499 ) * on Tuesday August 26, 2003 @11:37AM (#6794435)

    bash-2.04$ chsh /bin/tcsh

  • by jarran ( 91204 ) on Tuesday August 26, 2003 @12:13PM (#6794924)
    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:~>

  • There is speculation that the switch was made to appeal to Linux users.
    I would expect any experienced linux user to know how to change their shell without Apple's help.
  • Now, about "ps" (Score:4, Insightful)

    by The Bum ( 597124 ) on Tuesday August 26, 2003 @12:57PM (#6795455)
    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!
  • by macserv ( 701681 ) on Tuesday August 26, 2003 @01:20PM (#6795729)
    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.
  • by juntunen ( 321292 ) * <tmj@visi.com> on Tuesday August 26, 2003 @01:28PM (#6795831)
    I followed the link [apple.com] 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...
  • by Rorshach ( 113150 ) on Tuesday August 26, 2003 @02:48PM (#6796796)
    ...to the term mac bash-ing.

    ...or bourne again mac user.

  • by fricc ( 410400 ) on Tuesday August 26, 2003 @03:06PM (#6797062)
    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...
  • by Offwhite98 ( 101400 ) on Tuesday August 26, 2003 @05:17PM (#6798857) Homepage
    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.

To the systems programmer, users and applications serve only to provide a test load.

Working...