back to article Bish, Bash... gosh! Good ol' Bourne Again Shell takes a bow as it reaches version five-point-zero

In news that will set the hearts of shell fans all a quiver, Bash 5.0 was released this week, replete with a truckload of fixes along with a few new features. The fifth major version in the nearly 30-year history of the GNU Project’s Bourne Again Shell (Bash – geddit?) includes some new variables BASH_ARGV0, which returns $0 …

  1. Anonymous Coward
    1. W.S.Gosset

      > Yesh!

      Sean Connery. B007H

  2. tony2heads

    yes yes

  3. Forget It
    Joke

    $0 ?

    $0 - is that the payback for scripting bash?

    1. Francis Boyle Silver badge

      No

      That's the current paycheck for a US Government employee. Hopefully someone out there knows the syntax for assigning it a new value.

      1. Chairman of the Bored

        Re: No

        Ouch! Too close to home - daughter's first paid job just reverted to an unpaid internship - but have an upvote for a good, sharp reply!

        The syntax I used to get out of the gummnit did not use shellcode, I had to write it in resumescript.

        1. Paul Herber Silver badge

          Re: No

          The UK that is called CVS.

          1. elDog

            Re: No

            In the US CVS (a drugstore chain) is named after the snappy trademark: Customer, Value, Service.

            FWIW ($0).

  4. Pete 2 Silver badge

    Hello 1 - 2 - 3 - can you hear me at the back?

    > Naturally, we took the thing for a spin (using Ubuntu) and found the whole experience to be reassuringly uneventful.

    You mean .... someone might actually have tested it?

  5. Anonymous Coward
    Anonymous Coward

    "Trusty command interpreter"?

    "Trusty" is perhaps not the most appropriate word to use here.

    https://www.cvedetails.com/vulnerability-list/vendor_id-72/product_id-21050/GNU-Bash.html

    1. TonyJ

      Re: "Trusty command interpreter"?

      14 known issues listed there dating back to 1999 doesn't seem exactly bad to me, even taking into account the 6 or so scored at 10 - and I'm not a Linux specialist.

    2. Anonymous Coward
      Alien

      Re: "Trusty command interpreter"?

      I don't know if bash is secure or not: I assume, given how big it is, not. What I'm much more sure about is that shell scripts (bash or otherwise) of any complexity almost never are. And I recently discovered bash's programmable-completion stuff, which can involve a hundred or so shell scripts (actually functions, which are worse because they are less isolated from each other) being run every time you type tab. Some of these functions can do things like run python and ask it for the list of module names. I'd guess the chance of this system not being just infested with security holes is essentially zero. It's just horrifying.

      1. Steve Graham

        Re: "Trusty command interpreter"?

        I share your concern. Bloat and excessive "cleverness" which 99% of users don't need.

        Debian-like distros usually ship with dash, not bash as the default shell, and its executable is literally a tenth of the size.

        1. Teiwaz

          Re: "Trusty command interpreter"?

          Debian-like distros usually ship with dash, not bash as the default shell, and its executable is literally a tenth of the size.

          Good point, having switched from Ubuntu a while back, I'd forgotten that - Ubuntu has followed suit (being a Debian based distro) since 6.10.

          I assume in testing on Ubuntu that was taken into account?

          1. thames

            Re: "Trusty command interpreter"?

            Ubuntu works the same as Debian, as Ubuntu is a close derivative of Debian. There are two shells, the interactive shell and the non-interactive shell. If you simply open a terminal to type commands in you get the interactive shell, which is Bash. If you run a script with #!/bin/sh, then you get Dash. If you want your script to run with Bash, then you need to specify #!/bin/bash.

            Bash has features which make it easier to use interactively as well as more advanced syntax with which to write complex scripts. On the other hand, since Dash lacks those features the executable is smaller and so it starts up faster, which is useful if you are running lots of small simple scripts (like in the pre-Systemd init system when this combo originated).

            The main thing you have to look out for is when you specify #!/bin/sh in a script but then try to use advanced Bash features and get very unhelpful Dash error messages. This is not that uncommon if you google for scripting examples since so many people just assume that everyone uses Bash. If you are using a Debian derivative and get baffling syntax error messages in a third party script, it's worth a try to change the #! to specify Bash to see if that helps.

            Generally, I prefer working in Bash because the more user friendly syntax for advanced features means that I am less likely to make errors which have to be debugged. For really basic scripts however it doesn't make much difference.

  6. sabroni Silver badge

    "with the latter having microsecond granularity."

    Is that for side channel attacks?

    1. DropBear
      Trollface

      Re: "with the latter having microsecond granularity."

      Nah, it's just a backup for whenever the main microfirst granularity fails...

      1. TonyJ

        Re: "with the latter having microsecond granularity."

        That was so groaningly bad, I had to upvote it.

      2. sabroni Silver badge
        Trollface

        Re: Nah, it's just a backup for whenever the main microfirst granularity fails...

        Nice derail.

        Can't discuss security in a linux thread unless we're discussing how much better than Windows it is.

        1. CRConrad

          Re: “...discussing how much better than Windows it is”

          Actually, I don't think that had anything at all to do with Microsoft. It was just a simple pun on “second” being a unit of time — or, if not, then when the first service fails you switch over to the second one. So, if anyone here is seeing Windows behind every bush, that would seem to be you.

    2. Anonymous Coward
      Terminator

      Re: "with the latter having microsecond granularity."

      A world in which knowing the time accurately is a security problem is a world which is fucked in more ways than I can count. A world in which the fix for that problem is not to allow high-resolution timers is a world which is fucked in more ways than it is possible for anyone to count.

      How the fuck did we get here? What terrible sin did we commit as children that this awful crapness must be visited on us by some angry god? Can't we just burn it all down and start again? Please?

      1. Anonymous Coward
        Anonymous Coward

        Re: "with the latter having microsecond granularity."

        Give it time, give it time..

        /me hiding behind a pint :)

  7. dajames

    Bourne Again Shell (Bash – geddit?)

    Methinks that if there is humour here it is in "Bourne Again", rather than in the abbreviation that is "Bash", and to understand that you need to know that Bash was the successor to the Bourne shell, which was named after its creator, Stephen Bourne.

    1. Peter Gathercole Silver badge

      Re: Bourne Again Shell (Bash – geddit?)

      Probably the case that Bash was not the successor to the Bourne Shell, but to ksh, the Korn Shell, but the naming sort of still fits.

      I think it would be an interesting exercise for many of the commenters here to actually try to use the original Bourne Shell as their main shell for a period of time, so that they could appreciate how much a step up ksh, the Posix Shell and bash actually are.

      And for those who have hair-shirt tendencies, the Bell Labs. UNIX version/edition 6 shell (if you can format it - it appears it's not compatible with the groff version of the man macros installed on this Redhat system) is a real eye-opener!

      1. Anonymous Coward
        Anonymous Coward

        Re: Bourne Again Shell (Bash – geddit?)

        For the avoidance of doubt, can we just make clear that real programmers use csh? Or tcsh if they're feeling particularly decadent...

        1. David Roberts
          Windows

          Re: Bourne Again Shell (Bash – geddit?)

          csh - a shell which is strangely similar to but disturbingly different from the C programming language.

          Walk on past, stranger. That way lies madness.

      2. Anonymous Coward
        Anonymous Coward

        Re: Bourne Again Shell (Bash – geddit?)

        I don't think bash was really the successor to ksh in any useful sense. Some people probably had ksh, although I'm not sure who they were: it didn't ship with BSD distributions, or not any of the ones I used.

        Instead we had sh, csh and various derivatives of csh like tcsh. sh was too minimal to use interactively, csh was OK interactively and tcsh was quite nice. But both csh and tcsh were just horrors to write scripts in compared to sh. So bash came along having all the interactive niceness of tcsh and some more, while clearly being a Bourne-family shell.

        1. juice

          Re: Bourne Again Shell (Bash – geddit?)

          Back in a past life, i used to extensively use ksh on SGI and Sun kit, mostly because you could enable vi commands (i.e. ksh -o vi). Which in turn meant that you could search and repeat/edit past commands with ease.

          (It's also worth bearing in mind that these were the days when keyboard translations between systems could often be flaky - telnetting to a server and pressing left or right on a standard PC would often produce some on-screen garbage such as ~#^04c-. Using ksh meant that I didn't have to go digging around to figure out how to fix this for each of the servers I used to bounce around...)

          These days everything I work on runs linux, and the built-in bash facitilies (crtl-r to search, ctrl-left and ctrl-right to jump back and forward by a "word") are good enough that I don't really need anything more advanced.

          1. Long John Brass
            Happy

            Re: Bourne Again Shell (Bash – geddit?)

            Ahhh yes the good old combo...

            $ stty sane

            $ stty erase ^?

        2. Peter Gathercole Silver badge

          Re: Bourne Again Shell (Bash – geddit?) @tfb

          I was using SVR2 when I first came across ksh (ksh85, I think it was) in 1987. It was available as an exptool for AT&T related companies.

          ksh88 became accepted as part of R&D Unix for AT&T companies (and I think it was purchasable commercially for 3B2 systems), and shipped as a standard shell in SVR4 in 1989 (and thus available in SunOS 4). I think it made it's way into a lot of AT&T licensed and derived UNIX systems including AIX 3.1 onwards. I remember that I also came across it on a DGUX box and Digital UNIX systems.

          It became the basis for the POSIX shell (which was effectively ksh88 with a few tweaks), and I think that Bash was written to be a POSIXly compliant shell, which makes ksh a direct ancestor of Bash.

          Oh, and in answer to csh, what planet are you from! I know that some wierd people using BSD used csh (but many people on BSD didn't), but really it bore almost no relation to the Bourne shell. In my experience, most people only really used it because of the history features. And most of them only used it as an interactive shell, and wrote most of their scripts in the Bourne shell, even though csh was intended as a programming shell.

          I'm not saying that it could not be used, but when I compiled it up on a Bell Labs. V7 UNIX box from a BSD 2.3 tape in something like 1982, it felt so foreign and wrong that I quickly went back to the normal shell.

      3. W.S.Gosset

        Re: Bourne Again Shell (Bash – geddit?)

        > Probably the case that Bash was not the successor to the Bourne Shell, but to ksh, the Korn Shell

        As I understood it at the time, it was intended to be both.

        He wanted to revisit his original shell (which had clean scripting syntax), plus he wanted to add in all the post-sh User Interface ideas of which ksh was the pioneer and about the most advanced. Basically, sh functionality improved, ksh UX improved

        eg, instead of only having ksh's vi-style navigation possible, bash also included emacs-style navigation (ctrl-R to search-reverse, etc), which turned out to suit most people best in shell's text-entry-focus environment. Such that many people now think it came from bash not emacs.

    2. Anonymous Coward
      Anonymous Coward

      Re: Bourne Again Shell (Bash – geddit?)

      It is the new Bourne Identity, you could stick to the old Bourne legacy but eventually with bugs and stuff it will be a Bourne Ultimatum to upgrade.

    3. Wilberfarce

      Re: Bourne Again Shell (Bash – geddit?)

      A kind of Bourne Legacy, if you will.

  8. Anonymous Coward
    Anonymous Coward

    Rollin’

    In my 5-point-O

    With my rag top down so my hair can blow

  9. DrBobK

    Book him Danno!

  10. Vanir
    Trollface

    BASH - It's not as good as the DOS scripting 'language'!

    https://stackoverflow.com/questions/18819835/dos-batch-script

    1. Anonymous Coward
      Anonymous Coward

      You utter unfeeling bastard!

  11. Jove Bronze badge

    Feature Utilisation

    No doubt a lot of effort has gone into the new version, but in the vast majority of cases it will be used those nasty little horrors you come across that have been hanging around on systems for years.

  12. Jove Bronze badge

    From the announcement ...

    "This release fixes several outstanding bugs in bash-4.4 and introduces several

    new [ones]."

    Or did I just mis-read that? :)

    1. DJV Silver badge

      Re: From the announcement ...

      Hey, it's software - new bugs come as standard!

      1. TXITMAN

        Re: From the announcement ...

        It's a feature not a bug.

      2. Jove Bronze badge

        Re: From the announcement ...

        Undoubtedly; it was just the way the comment appears in the documention that lends itself to that interpretation.

  13. Jeffrey Nonken

    One thumbs-up for referencing the Bourne Supremacy's chase scene track, which is titled Bim Bam Smash. Bonus because it is my favourite track of the series. Also my favourite chase scene of the series.

  14. J.G.Harston Silver badge

    Why are there so many products rolling around to 5.0 just as I'm rolling around to 5.0 (times ten).

    1. Goobertee

      >>Why are there so many products rolling around to 5.0 just as I'm rolling

      >>around to 5.0 (times ten).

      Because you're so much younger than the rest of us?

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon