Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
Upgrades Software Linux

BASH 4.0 Released 459

An anonymous reader writes "The widely used Bourne-Again Shell (BASH) version 4.0 is out. The new major release fixes several remaining bugs in the 3.x releases, and introduces a bunch of new features. The most notable new features are associative arrays, improvements to the programmable completion functionality, case-modifying word expansions, co-processes, support for the `**' special glob pattern, and additions to the shell syntax and redirections. The shell has been changed to be more rigorous about parsing commands inside command substitutions, fixing one piece of POSIX non-compliance. Most of us will probably wait for the distros to test the new version and upgrade gradually, but you always have the option of grabbing the source and compiling it yourself. Enjoy."
This discussion has been archived. No new comments can be posted.

BASH 4.0 Released

Comments Filter:
  • by Froze ( 398171 ) on Monday February 23, 2009 @04:52PM (#26961629)

    Don't get me wrong, I really like bash, but the treatment of history is abysmal. The default behavior is to lose history due to a race condition when multiple bash sessions that are concurrently open are closed in arbitrary order.

    IMNSHO, the default of any process should be to never lose data.

  • Re:So? (Score:4, Insightful)

    by brasspen ( 899025 ) on Monday February 23, 2009 @05:02PM (#26961761)
    The day Ruby or Python takes over from the boot grub loader for the initialization of init levels in Linux on start up is the day your statement makes sense. Until then, I think people with your attitude love one tool too much. If you don't understand BASH, you don't really understand Linux. I think OS start up is a serious script.
  • Re:Circular what? (Score:5, Insightful)

    by slim ( 1652 ) <john.hartnup@net> on Monday February 23, 2009 @05:03PM (#26961777) Homepage

    What do you think was used to compile GCC?

  • Bourne Shell (Score:3, Insightful)

    by russotto ( 537200 ) on Monday February 23, 2009 @05:07PM (#26961827) Journal

    If you want your scripts to be compatible with just about every Unix, you still need to stick with /bin/sh (yes, I know, it's a compatibility mode). If you don't, might as well use a better scripting language.

  • by multisync ( 218450 ) on Monday February 23, 2009 @05:13PM (#26961907) Journal

    Perhaps this year, Linux will be ready for the desktop.

    Linux has been ready for the desktop for years. It's just that certain users are not yet ready for Linux.

  • by mea37 ( 1201159 ) on Monday February 23, 2009 @05:13PM (#26961909)

    I'll grant I haven't thought this all the way through, but a slightly lighter-weight approach than daemons and databases might look like this:

    Each open session logs history to a uniquely-named file. Then on session close, that file can be appended to the one true history file. (A bit of file locking can maintain atomicity of the append step.)

    When you scroll back into history, you would start with your own session's still-open-and-separate history file -- which is more often than not what I'd expect, but not always what I get today. If you go back beyond the beginning of that, I supposed you'd scroll into the accumulated history of closed sessions.

    This means that one session doesn't "see" the history from a concurrent session while they're both open. That, too, can be addressed, even if it has to wait for a subsequetn release. Either way, it's better than just losing the data IMO.

  • Re:Bourne Shell (Score:4, Insightful)

    by Tony Hoyle ( 11698 ) * <tmh@nodomain.org> on Monday February 23, 2009 @05:30PM (#26962157) Homepage

    Solaris 9 (10 is *far* from universal, hell, even 8 is pretty common). HPUX. Tru64. That's three off the top of my head.

    People have ported GNU to them but you just can't rely things like bash being there - you have to be able to work with the out of the box environment.

  • Re:So? (Score:3, Insightful)

    by EddyPearson ( 901263 ) on Monday February 23, 2009 @05:38PM (#26962247) Homepage

    Do you use bash on a day to day basis?

    I love using bash scripting inline, so to speak. The speed that you can get complex things done on the commmand line (and you might be surprised how much you can do with a little ingenuity) is due in no small part to the flexibility of the bash scripting language.

    Sure, you could fire up vi (or perhaps nano?) and write a "serious" script to help you get the job done, but my way's quicker.

  • by richlv ( 778496 ) on Monday February 23, 2009 @05:38PM (#26962249)

    it would be quite cool if they could set up at least something something resembling homepage.
    you know, the thing with announcements, news, and, ooooh, release notes !
    wiki probably would be too much to ask.

  • Re:Bourne Shell (Score:5, Insightful)

    by TheRaven64 ( 641858 ) on Monday February 23, 2009 @05:42PM (#26962307) Journal
    Not available? Not many. Not installed as standard? *BSD, Solaris, AIX, and any Linux that isn't GNU/Linux. POSIX mandates the existence of /bin/sh and a set of commands it must understand. Any POSIX system will have this, and it's possible to write complex scripts using only these features. Using bash extensions means that you are writing a GNU shell script, not a portable shell script. This may be fine for you, but you've just added another dependency to your program.
  • Re:So? (Score:3, Insightful)

    by value_added ( 719364 ) on Monday February 23, 2009 @05:50PM (#26962409)

    Tons of fun for a certain kind of hacker, but not of any interest for people writing serious scripts.

    Most serious scripts are (and continue to be) written using /bin/sh. Maybe your definition of serious is something different?

    But the scripting community has moved on, and doesn't really care that Bash or Csh now have features that other scripting languages acquired decades ago.

    Huh? Some of the new features are welcome for interactive use, and bash is extremely popular in that regard. Feature parity (in a general hand-wavy sense) doesn't exist between bash, csh, zsh, etc., so decades later, the choice of shells remains important, as does continued development.

    Personally I use bash (with plenty of Perl one-liners thrown in for good measure), but I'd be misguided to think that bash (or Perl) is available everywhere, or didn't concede that other shells do certain things far better.

  • by morcego ( 260031 ) on Monday February 23, 2009 @05:54PM (#26962465)

    Linux has been ready for the desktop for years. It's just that certain users are not yet ready for Linux.

    You are too kind. In fact, most users are not ready to operate computers. At all.

  • Re:Bourne Shell (Score:3, Insightful)

    by dgatwood ( 11270 ) on Monday February 23, 2009 @05:59PM (#26962521) Homepage Journal

    Out of the box? My guess is "almost all of them", at least where BASH 4 is concerned. Outside of the Linux community, BASH 4 will pretty much be stillborn. I expect close to zero adoption.

    Why? GPL v3. The *BSD community is working hard to replace everything the FSF produces with BSD-licensed code because GPL v3 is so offensive to them. They're well on their way even in hard-to-fill spaces like compiler technology. With shells, they already have several viable replacements, so there's no point in continuing to drag along the licensing baggage that is BASH. They'll just include Zsh and pdksh instead and most people won't care. The folks who do can compile and build BASH themselves. I'd expect it to be rejected by many of the corporate-backed UNIX/Linux distros as well.

  • I hate [T]CSH (Score:5, Insightful)

    by Khopesh ( 112447 ) on Monday February 23, 2009 @06:01PM (#26962549) Homepage Journal

    One of my favorite bookmarks, Csh Programming is Considered Harmful [uni-giessen.de], is very useful for shell scripting in Bourne, Csh, and Bash. Oh, and it's also a good reminder of why you should never write csh scripts.

    In my experience, the only [t]csh users out there are those who used it back in the day before there were other options, or those who are so embedded in the C/C++ world that they thought it a good idea to use a C/C++ -styled shell. That's fine, use that shell. DON'T write scripts in it though. It's annoying. (More annoying: ln -s /bin/csh /bin/sh ... this breaks TONS of things as /bin/sh must be posix-compliant. Csh doesn't even want (or try) to do that!)

  • Re:So? (Score:3, Insightful)

    by Anonymous Coward on Monday February 23, 2009 @06:15PM (#26962705)

    You're an idiot.

    The shell is my file manager, and my entire dev toolchain works from the shell. Shell scripting is better suited to linking together unix commands that pipe text between one another. I don't particularly want any scripting interpreters other than bash and awk to be _required_ on my systems. I like lua and javascript, some folk prefer perl, python or ruby but nobody is getting very far on a unix-like system without /bin/sh and the de-facto standard for that is bash.

  • Feeding a troll (Score:4, Insightful)

    by Froze ( 398171 ) on Monday February 23, 2009 @06:35PM (#26962967)

    Yes, I am complaining about the default behavior.

    How about if we made the default for mv to delete blocks as they were copied and not wait to delete to original until a full copy was made. This would be 'good' (more efficient) most of the time and break in strange corner cases, losing the users data (not a good thing^TM).

    The default behavior should *NOT lose data*. To do so is bad UI design.

  • by wsanders ( 114993 ) on Monday February 23, 2009 @06:35PM (#26962971) Homepage

    Bah. History files are a horrible security problem. History belongs in memory. I can count on about ten hands the number of times I have found passwords and various other sensitive information in them.

    First line in my .bashrc files: unset HISTFILE

  • by DiegoBravo ( 324012 ) on Monday February 23, 2009 @06:42PM (#26963047) Journal

    Most people don't need to operate computers directly. But a lot of people uses them more or less indirectly, for example, when driving a modern car, or when redacting a letter in MS Word. The idea is that people should never have to be ready for (nor aware of) any OS at all.

  • by Anonymous Coward on Monday February 23, 2009 @07:12PM (#26963345)

    a richer bourne-shell and ksh-based programming language

    Interesting. Whenever I needed to write programs beyond what POSIX sh could handle, I just eschewed shell entirely and went up to Perl/Python/Ruby. Still even more powerful, and installed on far more boxes.

    bash, ksh, zsh, etc. are still better for interactive use, but salivating over their programming features is really missing the forest for the trees, in my opinion.

  • Re:CORRECTION (Score:5, Insightful)

    by Jurily ( 900488 ) <jurily&gmail,com> on Monday February 23, 2009 @09:03PM (#26964371)

    ...MOST users.

    To be fair, most users have trouble setting the clock on a VCR.

  • by moosesocks ( 264553 ) on Monday February 23, 2009 @09:48PM (#26964715) Homepage

    It's gotten a lot better, but there are still gaps that need to be filled in.

    Today, I had to enable printer sharing (via Samba for Windows clients) on my parents' computer, which is running Ubuntu.

    Although the majority of the desktop is very well-integrated, the process for doing this was *extremely* non-obvious.

  • by Anonymous Coward on Monday February 23, 2009 @11:03PM (#26965215)

    Somebody needs to learn the difference between primary and secondary memory. Hint: drives *are* memory.

    But yeah, most people are right that it's memory, but not for the reasons they think they are.

  • by Anonymous Coward on Tuesday February 24, 2009 @12:40AM (#26965763)

    Well you *wouldn't* see an attacker who spent any time bothering with rootkits or covering his tracks if you're only looking at .bash_history, now would you? :)

  • by SmallFurryCreature ( 593017 ) on Tuesday February 24, 2009 @03:19AM (#26966615) Journal

    He has a garage, fixes cars. He LOVES people that don't think they need to operate their car. Some lovely person puts petrol in the company van, ah christmas come early! Oil light been on since "Oh I just ignore that as the car starts fine with it on", we will eat tonight!

    The simple fact is that we got to know a lot of stuff and if we don't we pay other people a LOT of money for knowing their stuff. 175 euro for 15 minutes work unglogging a toilet because some female doesn't know you can't put femine hygiene products down the toilet.

    50 euro to run a set of automated tools on your PC to clean it, total labor involved, inserting a USB stick, you got to bring the PC in, during quiet hours and pick it up yourself, no warranty.

    My neighbour changed his the nature of his small construction firm, he no longer does projects for clients, he assists DIY'ers with theirs. To translate, he charges a FORTUNE to fix the mess they made and has their free labor to help out with simple but expensive to hire a pro for tasks.

    Everytime somebody like you defends people not having to know the tools they use, somebody somewhere sees dollar signs.

  • Re:Bourne Shell (Score:2, Insightful)

    by Anonymous Coward on Tuesday February 24, 2009 @04:08PM (#26974299)

    I'd expect it to be rejected by many of the corporate-backed UNIX/Linux distros as well.

    Unless there are huge incompatiblities with Bash 3.0 (which there aren't), the distros will pick it up at the normal rate. GPLv3 doesn't scare the corporate-backed distros. Why should it?

The only possible interpretation of any research whatever in the `social sciences' is: some do, some don't. -- Ernest Rutherford

Working...