Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Announcements GNU is Not Unix Operating Systems Software Unix Linux

Bash 3.0 Released 507

qazwsx789 writes "The first public release of bash-3.0 is now available via ftp and from the usual GNU mirror sites. For the official release notes by the author, Chet Ramey, check his usenet post."
This discussion has been archived. No new comments can be posted.

Bash 3.0 Released

Comments Filter:
  • by Stevyn ( 691306 ) on Thursday July 29, 2004 @10:24AM (#9831916)
    ...a GTK front end
  • by Just Some Guy ( 3352 ) <kirk+slashdot@strauser.com> on Thursday July 29, 2004 @10:25AM (#9831928) Homepage Journal
    Bash was my first shell and I used it exclusively for years. One day, I'd read enough about zsh to force myself to give it a try. Oh how I loved thee, bash, but I won't be going back.
    • by Anonymous Coward
      zsh is nice, but bash still has its applications. I run zsh on most places, but my laptop, and servers that are somewhat underpowered, stick with bash as a nice balance between the baroque zsh and a lightweight, but less usable shell.
    • by Anonymous Coward
      insightful? please at least give a few reasons why zsh is better. I use bash, but i'm open to other possibilities.
      • by opk ( 149665 ) on Thursday July 29, 2004 @10:46AM (#9832230) Journal
        Globs are more powerful: **/*.c will recursively search for .c files: much quicker to type than find.
        You can match file types: e.g. *(@) will get you symlinks. *(U) gets files owned by you.

        Syntax for alternation is a lot easier. No @(this|that) or !(*.f). Instead, it is (this|that) and ^*.f

        Next point is completion. It includes a vast range of definitions so completion works well for lots of commands. The completion system handles completing parts of words so it better handles user@host completion. You get descriptions with completion match listings. Completion also has a really powerful context sensitive configuration system so you can make it work the way you like.

        It has modules. For running a simple shell script it will actually use less space than bash because it doesn't need to load the line editor and other interactive related code into memory.

        There is much much more. It takes a while to learn everything but if you just enable the completion functions (autoload -U compinit; compinit) you'll find it better than bash or tcsh from day 1.
      • by Just Some Guy ( 3352 ) <kirk+slashdot@strauser.com> on Thursday July 29, 2004 @10:50AM (#9832279) Homepage Journal
        Bigs ones for me:
        • A sane auto-completion system. That is, "cvs <tab>" gives a list of all of the commands that cvs understands. "cvs -<tab>" (same as above but tabbing after typing "-") gives a list of all of the options that cvs understands. These are good things. Now, in fairness, bash also has a command completion library. Unfortunately, it's implemented as a huge set of Bash functions. In zsh, "set|wc" returns 179 lines. In bash, "set|wc" returns 3,961 lines. The net effect is that zsh's system is noticeably faster and less polluting to the local environment.
        • Modules. Wrappers for TCP connections, a built-in cron thingy, and PCRE are all loadable modules to do tricky things easily.
        • Lots of pre-defined things. Load the "colors" and "zsh/terminfo" modules and you get defined associative arrays like $fg, which emits terminal-appropriate escape codes to set the foreground color of printed text. The command "echo ${fg[red]}red text${fg[default]}normal text" prints "red text" in red, and "normal text" in your default color.

        Bash is a good shell, and I have nothing bad to say about it. However, zsh seems to have been designed from the ground up by power users and for power users. I absolutely love it and everyone that I've given a example config file to (to get them running with little hassle) has permanently switched.

    • Indeed: I've been a zsh convert for a while now (since I'm a slowish and lazy typer), and zsh is just the best shell environment by far.

      As far as scripting is concerned, however, there's not a great deal of difference between zsh and bash, since the former is quite compatible with the latter.

    • by Anonymous Coward on Thursday July 29, 2004 @10:34AM (#9832068)
      Will everyone stop with the Bash bashing, please?
    • by Just Some Guy ( 3352 ) <kirk+slashdot@strauser.com> on Thursday July 29, 2004 @11:41AM (#9832870) Homepage Journal
      Man, all I wanted to do was say that I also liked zsh. I didn't think that many people were so wrapped up in their shells.

      My post started with +2 (cause I are 1337). Then I got an "Interesting", two "Overrated"s, a "Funny", and most recently a "Flamebait".

      Come on, mods: can I have an "Insightful" and an "Underrated", too?

    • by Nachtfalke ( 160 ) on Thursday July 29, 2004 @12:30PM (#9833621) Homepage
      Up until recently, I also was a zsh user. But bash has one thing going for it, that zsh does not do: work with a UTF-8 locale.
      The zsh line editor get's totally confused if you type for example an umlaut and backspace over it.
      And since my native language uses umlauts, and I need a UTF-8 environment for work, I had to go back to bash. Unfortunately...
  • A new version? (Score:5, Interesting)

    by moonbender ( 547943 ) <moonbender@gUUUm ... inus threevowels> on Thursday July 29, 2004 @10:26AM (#9831938)
    Hell, I didn't even know bash was still in active development. It was always just bash to me, not bash-x.y.z. But then I guess I wouldn't notice the difference, really.
    • Dear Apple haters... (Score:5, Informative)

      by TheHonestTruth ( 759975 ) on Thursday July 29, 2004 @10:31AM (#9832033) Journal
      From the release notes:

      Several bug fixes for POSIX compliance came in from Apple; their assistance is appreciated.

      It looks like Apple is giving back to the community, and to a fundamental tool.

      To the parent: I'm in the same boat. I thought bash 3?? What is there to add?? Looks like multibyte char support (sorry, I'm are a dum Amer'kin).

      -truth

      • The one thing I find weird with Apple adding stuff to bash is that's Mac OS X's default shell is tcsh. But it is nice of Apple anyway...
      • by Jahf ( 21968 ) on Thursday July 29, 2004 @10:58AM (#9832361) Journal
        Believe it or not, -most- of the large companies that use GPL'ed tools give back to the community.

        Apple has done numerous fixes, not just on BASH.

        Sun (disclaimer: for whom I work) has done -tons- of work on GNOME, Mozilla and don't forget Open Office (just to name a few).

        IBM works on many projects and gives back ... plus contributing all new things like JFS.

        All the distro makers like Red Hat, Novell, etc give back tons.

        Each of those companies pay engineers to fix pieces not done in Open Source projects as well as to extend them for their customers. The patches are covered under GPL just like the main code, and these companies know it and yet knowingly dedicate serious money and hours to these projects. And then they satisfy the GPL by putting them out on source CDs or submitting them back to the main projects.

        The big problem for getting submitted code accepted is that these companies are usually fixing and developing on a codebase that is aging. For instance, Sun did numerous I18N fixes for GNOME 2.6, but by the time they were ready the main GNOME organization had moved on to 2.8. That means there is a disconnect between the two and the changes have to be ported forward before they will hit the main code branch. The same problem can happen with kernel patches and just about any other codebase that changes versions so quickly.

        Sorry, you were doing the good thing and pointing out Apple's contributions. But so many people think these companies violate the GPL (in spirit if not in law) when they are very large contributors to open source. Sure, some do, and the community usually find out about it and shame them into minimal compliance (Linksys and Sveasoft come to mind after my delving into alternate WRT54G firmwares last night), but generally speaking the big companies have been a good part of the community.
  • by meringuoid ( 568297 ) on Thursday July 29, 2004 @10:27AM (#9831949)
    System-specific changes for: SCO Unix 3.2

    What are these, I wonder? Something along the lines of changing the prompt to always display [litigious@bastards]$, perhaps?

  • Neat (Score:5, Interesting)

    by stratjakt ( 596332 ) on Thursday July 29, 2004 @10:27AM (#9831954) Journal
    Someone tell me why I want this. The Usenet post doesn't seem to explain what's so exciting about it, besides a bunch of boring bug-fixes, and some esoteric-sounding syntax changes.
  • Not much changed (Score:5, Insightful)

    by opk ( 149665 ) on Thursday July 29, 2004 @10:28AM (#9831965) Journal
    Doesn't seem to be much changed given the version number increase. [[ =~ ]] can match regexes and it can do zsh style {1..3} expansions. Improved multibyte support too. There were bigger changes in some of the 2.0x updates.
    • by devphil ( 51341 ) on Thursday July 29, 2004 @11:43AM (#9832896) Homepage


      The plan was to introduce new features in sub-versions like .04a, .05a, .05b. Then let them stabilize. Once the bugs were worked out, that would be 3.0.

      As opposed to most open source software, which releases x.0 as soon as it compiles, and only then starts working out the stability bugs.

  • I am looking at the title going a Linux bash headline on slashdot, now i must have been dreaming. But I am sure that i would not post that here, knowing i would loose all my karma in one stroke.
  • Apple helping out (Score:5, Interesting)

    by Macka ( 9388 ) on Thursday July 29, 2004 @10:30AM (#9832019)

    Several bug fixes for POSIX compliance came in from Apple; their assistance is appreciated.

    It's nice to see yet more contributions from Apple to the OSS community.
    • by hot_Karls_bad_cavern ( 759797 ) on Thursday July 29, 2004 @10:43AM (#9832194) Journal
      "It's nice to see yet more contributions from Apple to the OSS community."

      Right on, brother. (This is not bashing apple before i get started!) They have done something that no one else in the *nix world has done: shit-hot gui. People can blather about this and that, but to deny that Apple has created one of the most user-friendly, beautiful, slick gui's for *nix is crazy. I'd like to continue seeing Apple release more help to OSS. Keep the real money makers to themselves (for now), but allow more dev's to release usefull changes back to the community that helped build it ya know?

      You are 100% correct that it's nice to see them making another move like this...even if it was a lil' one :)
  • by Bistronaut ( 267467 ) on Thursday July 29, 2004 @10:33AM (#9832055) Homepage Journal
    They should have called the movie Bourne Again [imdb.com].
  • by FreemanPatrickHenry ( 317847 ) on Thursday July 29, 2004 @10:33AM (#9832058)
    The Bourne Again and Again and Again Shell! Again!
  • sco sco sco (Score:2, Funny)

    by gl4ss ( 559668 )
    **b. System-specific changes for: SCO Unix 3.2, Tandem.**

    I wonder.

    if sco then blowup
  • by g_adams27 ( 581237 ) on Thursday July 29, 2004 @10:37AM (#9832107)

    Yeah, Bash 3.0 is great and all, but when are the bash people going to upgrade rbash? Man, I can't do anything with that shell!
  • by Anonymous Coward

    I seriously hope they've fixed that bag. Since a lot of GNU/LNUX distros don't even ship with a real sh, but symlink to bash. Some random linux bozo makes a #!/bin/sh script thinking it will be portable, but bash (at least 2.x does) forgets to switch off some features when invoked as /bin/sh, so in the end you write a non-portable script. And listen, linux people, /bin/bash is not standard!

    Alfred, tired of fixing stupid scripts that assume the whole world has bash in /bin.

    • by pohl ( 872 ) on Thursday July 29, 2004 @12:59PM (#9834103) Homepage
      Proprietary \Pro*pri"e*ta*ry\, a. [L. proprietarius.]
      Belonging, or pertaining, to a proprietor; considered as
      property; owned; as, proprietary medicine.
      [1913 Webster]

      Seems like an odd word to use to describe free software. Try not to lip-sync to the jargon, dude.

    • I think only a few would even try to argue that they are. Most shells aren only somewhat available on non *nix OSs & many aren't available ay all off of them. Bash is, at least, reasonably available on most OSs. It is also the de facto shell standard, being found on linux and most newer *nix variants.

      Portable shell scripts are probably more impeded when they use tools that aren't part of the shell & which aren't on the target system.

      If you want true script portability, it is probably better to u
  • by Etcetera ( 14711 ) * on Thursday July 29, 2004 @10:41AM (#9832171) Homepage

    Looks like a nice Unicode-savvy release that should help with dealing with international languages at the command line. And yay to Apple for giving back (again). When will people finally accept that Apple is indeed helping out the OSS community through GCC, bash, and other tools...?

    Kind of off-topic, but for speed purposes in scripts that have to run fast, I find nothing better or more convenient than Ash, especially on systems where /bin/sh is a symlink to /bin/bash.

    Does anyone know any history on this shell? Is it a clone of the original bourne shell or of bash? I can't seem to find anything useful on Google ...

  • I can't be the only one who snickers every time I see a commercial for this film. Think Geek used to have a "Bourne Again Believer" t-shirt but I think they dropped it. Maybe I am the only one.

  • by Ashe Tyrael ( 697937 ) on Thursday July 29, 2004 @10:42AM (#9832179)
    There's been an interesting little problem caused for people like Gentoo with the updates in bash 3.0.

    http://bugs.gentoo.org/show_bug.cgi?id=58703 [gentoo.org]

    Just a simple move towards compliance breaks most of their scripts, so they've had to patch it out.

    Lovely.
    • by AT ( 21754 )
      If you use bash specific features, you should be starting your shell scripts with #!/bin/bash (or #!/usr/bin/bash, depending on the installation path) instead of #!/bin/sh. With bash 3, the former allows the non-POSIX stuff that bash has always allowed, but the latter disallows at least some of it.
    • by keesh ( 202812 ) * on Thursday July 29, 2004 @11:35AM (#9832799) Homepage
      It's a problem with autoconf, not with any Gentoo-specific scripts. You're just more likely to see it on Gentoo given how much you end up running autoconf :)
  • MSH (Score:4, Funny)

    by Jugalator ( 259273 ) on Thursday July 29, 2004 @10:42AM (#9832181) Journal
    Ha ha, you dorks, use MSH [wikipedia.org] like a man!

    I wonder how this will get modded? :-o
  • command.com-3.0. But I guess a more robust cmd.exe would do as well.
  • POSIX (Score:5, Funny)

    by Waffle Iron ( 339739 ) on Thursday July 29, 2004 @10:45AM (#9832211)
    This statement had me a little confused for a while:

    Several bug fixes for POSIX compliance came in from Apple; their assistance is appreciated.

    Then I looked through the POSIX spec, and sure enough I found this section, which explained things:

    POSIX section 23.4.18 (SHELL):

    To the extent possible on the terminal hardware, the shell
    shall present to the user the appearance mimicing a translucent plastic material. The shell rendering material model should incorporate prominent specular highlights suggesting a shiny smooth surface. The shell should cast fuzzy shadows on any user interface elements that lay below it.
  • Just wondering... (Score:4, Interesting)

    by Kynde ( 324134 ) <kynde.iki@fi> on Thursday July 29, 2004 @10:48AM (#9832248)

    What is so hot about bash, e.g. compared to zsh?

    Seriously, I'm not trying to start a flame war here. This is coming from a really long term zsh user because back when I was just starting unix and linux a fellow bearded unix guru told me something along the lines "go with zsh, it's the best" (thas was about -95). And I've never looked back, but now seing bash being the default shell in most distros I've began to wonder what's going on. Perhaps over the years bash overtook zsh or there are some hidden qualities in bash that I don't know about.

    Anyone with some insight on _both_ shells would be greatly appreciated.
    • Re:Just wondering... (Score:3, Interesting)

      by jandrese ( 485 ) *
      Bash is so hot because it is the default shell in most Linux installs. Zsh is hidden off somewhere in the package system, so you have to know about it to try it out. Because all of these people who make distros started with Bash, they assume everyone else is using it too and perpetuate the cycle.

      It's the same reason IE is still the de-facto browser on the internet, for most people it came with the system. Also, if you jump around on lab machines or on other people's machine, more often than not they
    • Re:Just wondering... (Score:5, Informative)

      by opk ( 149665 ) on Thursday July 29, 2004 @11:05AM (#9832448) Journal
      Zsh is still the best.

      Bash developers have different priorities.
      Bash became the default primarily because it is GNU.
      Zsh has some ugly but powerful features like nested expansions. The two areas where bash is better than zsh is multibyte support and POSIX compliance. Much of that was contributed by IBM and Apple respectively. But if you use the shell a lot, you'll find zsh does a lot of things better. The completion is amazing. And when it isn't emulating sh/posix, it fixes some of the broken design decisions (like word splitting of variables) which saves you from doing stupid things.

      The FSF actually does development in a very closed manner when it can (the gcc egcs split was partly because of this). Bash is a good example of this. That perhaps a good thing because it is probably good that bash doesn't get some of zsh's nasty (but powerful) features. And if zsh didn't exist, bash might have been forked by now. If you care about your shell, you'll find much more of a community on the zsh lists than the spam filled bug-bash list. You can't even get at alpha releases of bash without being one of the chosen few.
  • Breaks Gentoo (Score:4, Informative)

    by Kujah ( 630784 ) on Thursday July 29, 2004 @10:48AM (#9832254) Homepage
    Gentoo's various scripts rely on the fact that /bin/sh is usually symlinked to /bin/bash. With 3.0, when invoked as /bin/sh, bash behaves as it should for the first time, which caused some problems. (which are now fixed, by the way)
  • by dara ( 119068 ) on Thursday July 29, 2004 @10:54AM (#9832323)
    I read the announcement and it mentions "History traversal with arrow keys", but what I would really like doesn't seem to be mentioned (but perhaps it is possible with bash-2.05, I'm not much of a shell expert). In Matlab, the up-arrow key searches the history for commands that match all the characters on the line. No characters and it acts like a normal bash arrow, if "figure, plot" is at the beginning of the line, it will quickly scroll through all plotting commands that have been entered at the shell.

    Any idea if this is possible?

    Dara Parsavand
  • Bash isn't Linux (Score:3, Insightful)

    by gorim ( 700913 ) on Thursday July 29, 2004 @10:56AM (#9832344)
    Bash is a portable tool that existed long before Linux did. It is not specific or particular to Linux. So why in the world does this get posted under the category of Linux ?
  • History timestamps! (Score:5, Informative)

    by straponego ( 521991 ) on Thursday July 29, 2004 @10:58AM (#9832359)
    Bash can now store timestamps in the history and save them to the history file. This alone is worth the upgrade for me. The option to erase duplicates is pretty nice too.
  • by Anonymous Coward on Thursday July 29, 2004 @11:12AM (#9832529)
    Guys, I'm really so excited about this. I ran around proclaiming the news about bash-3.0 in my department. Not too many people got excited (I work in Psychology) but check this out:

    [user@mitral user]$ echo $BASH_VERSION
    2.05a.0(1)-release
    [user@mitral user]$ a | b |cat
    bash: a: command not found
    bash: b: command not found
    [user@mitral user]$ echo $?
    0

    [user@mitral bash-3.0]$ echo $BASH_VERSION
    3.00.0(1)-release
    [user@mitral bash-3.0]$ set -o pipefail
    [user@mitral bash-3.0]$ a | b |cat
    bash: a: command not found
    bash: b: command not found
    [user@mitral bash-3.0]$ echo $?
    127

    Feel the love!
  • history (Score:3, Informative)

    by kungfujew ( 682569 ) on Thursday July 29, 2004 @11:23AM (#9832658)
    timestamped history sounds like a useful auditing feature....
  • by Stopmotioncleaverman ( 628352 ) on Thursday July 29, 2004 @11:24AM (#9832665)
    ...Bush 3.0. I was wondering why the last two incarnations of your US president were so god-awful. ;)
  • by taradfong ( 311185 ) * on Thursday July 29, 2004 @02:35PM (#9835561) Homepage Journal
    Remember 4DOS? They had this great feature: if you typed a directory all by itself on a command line, it would jump to that directory. It saved you typing all that cd nonsense. When you think about it, this makes sense as there is never (at least that I can think of) any other case where just typing a directory does anything else. I mean, why type...
    [user@server somedir]$ cd /etc/rc.d/rc0.d/
    ...when you could type...
    [user@server somedir]$ /etc/rc.d/rc0.d/
    It always surprised me that no one implemented this in bash, and finally I got around to doing it myself. It's a very simply change to only one file. My patch is to 2.05b - will have to do the 3.0 patch soon.

    http://mattwalsh.com/twiki/bin/view/Main/BashDirec toryJumpPatch/ [mattwalsh.com]

    The one 'hole' is that command completion is a bit weird for the first element of a directory...if you have a directory that starts with 'ls', and you type ls <TAB> it will complete with 'ls'. Still, I find it to be very useful.
  • Bash 3.0 (Score:3, Funny)

    by cygnus ( 17101 ) on Thursday July 29, 2004 @02:35PM (#9835569) Homepage
    leave 3.0 alone! >:(
  • by wowbagger ( 69688 ) on Thursday July 29, 2004 @02:42PM (#9835672) Homepage Journal
    What I would like to see Bash do is command completion a la 4DOS:

    If I have a command
    foo bar baz

    in my history, and I type
    foo<TAB>

    It complete that with the most recent command starting with "foo", and if I type
    foo<UP>
    it will cycle through the commands in history that start with "foo".

No spitting on the Bus! Thank you, The Mgt.

Working...