Slashdot Mirror


BASH 4.0 Released

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

11 of 459 comments (clear)

  1. looks like it still loses history by Froze · · Score: 5, Insightful

    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.

    --
    -- The morphemes of your disquisition are ascertainable, but they have eschewed an ambit of transpicuous exposition.
    1. Re:looks like it still loses history by mea37 · · Score: 4, Insightful

      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.

    2. Re:looks like it still loses history by wsanders · · Score: 4, Insightful

      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

      --
      Give a man a fish and you have fed him for today. Teach a man to fish, and he'll say "WHERE'S MY FISH, YOU IDIOT?"
  2. Re:So? by brasspen · · Score: 4, Insightful

    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.

  3. Re:Circular what? by slim · · Score: 5, Insightful

    What do you think was used to compile GCC?

  4. Re:This is excellent news by multisync · · Score: 5, Insightful

    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.

    --
    I don't care why you're posting AC
  5. Re:Bourne Shell by TheRaven64 · · Score: 4, Insightful

    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.

    --
    I am TheRaven on Soylent News
  6. Re:This is excellent news by morcego · · Score: 5, Insightful

    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.

    --
    morcego
  7. I hate [T]CSH by Khopesh · · Score: 5, Insightful

    One of my favorite bookmarks, Csh Programming is Considered Harmful, 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!)

    --
    Use my userscript to add story images to Slashdot. There's no going back.
  8. Re:CORRECTION by Jurily · · Score: 4, Insightful

    ...MOST users.

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

  9. Ah, a friend of mine LOVES you by SmallFurryCreature · · Score: 4, Insightful

    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.

    --

    MMO Quests are like orgasms:

    You may solo them, I prefer them in a group.