Announcement

Collapse
No announcement yet.

GNU Bash 5.1 Released With New "SRANDOM" Variable As A New Means Of Randomness

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #11
    Originally posted by dirlewanger88

    Shell scripts should be written in POSIX sh, unless there's a reason not to. bash and zsh mostly add interactive features. Even arrays seem to be coming to sh in the next POSIX spec.

    Also, there's nothing "modern" about bash (not that "modern" actually means anything these days).
    I do not hate myself enough to write pure POSIX shell scripts. My scripts are written with all bashisms I need to get the job done in a reasonable fashion and are expected to be executed in bash by the end user.

    Its my main programming language after all, so I write a lot of lines of bash per month.

    Comment


    • #12
      Anyone who is having difficulties compiling bash-5.1 because of a seemingly missing include file "builtext.h" try compiling it without parallelisation (i.e. make -j1). There is evidently a dependency missing and causing the build to randomly fail.

      Comment


      • #13
        Originally posted by Alexmitter View Post

        I do not hate myself enough to write pure POSIX shell scripts. My scripts are written with all bashisms I need to get the job done in a reasonable fashion and are expected to be executed in bash by the end user.

        Its my main programming language after all, so I write a lot of lines of bash per month.
        I used to be a POSIX/sh defender, especially in regards to OS scripts, but at some point it's like saying I'm not going to use Python because it might not be installed on someone's PC or some Python person saying I'm not gonna use Pip because someone might not have the internet available.

        So now I use Zsh and Bash isms and I don't care about maintaining compat with sh. #!/bin/not-sh ain't that hard to figure out

        Comment


        • #14
          Originally posted by dirlewanger88
          Shell scripts should be written in POSIX sh, unless there's a reason not to...
          ... and there is plenty of reason not to!

          What you want to say is that one should use a better shell than what the basic standard has to offer when possible. One finds bash on almost every and even the most basic Linux installations. There is plenty of goodness in bash worth using. From associative arrays, arithmetic expressions, extended variable substitutions and lots more.

          I would sooner force a user to install bash before I give up on these features, because giving up on these when you need them means you'll have to implement these through other means such as command pipes where you end up wasting lots of CPU cycles, create dependencies on external commands (i.e. expr, sed, basename, etc.), and will have to rely on their standard conformance, too.

          POSIX sh is a standard for creating backwards compatibility. Only use it when you need this compatibility more than anything else. Most distribution, i.e. Debian-based ones, use a mix of bash and sh scripts for the system and you can rely on finding a /bin/bash installed.

          And when bash isn't enough then don't hesitate to use perl or python or something else. Don't go backwards, but use the better tools that are out there.

          Comment


          • #15
            Originally posted by microcode View Post

            FWIW fish is incompatible even with most POSIX shell stuff. It's no great big deal that it doesn't yet also include this special symbol.
            I can run a lot of Bash stuff and all Bash scripts from fish, so it's not *that* incompatible.

            Comment


            • #16
              Originally posted by dirlewanger88
              ...
              Take a deep breath, stay calm, then read your own comment again and then try to read and comprehend the comments of others in their entirety.

              Right now are you obsessed, suffer a superiority complex and write comments like a child who is counting with its fingers, and I cannot imagine that you would want to be taken serious.

              Comment


              • #17
                Originally posted by jabl View Post

                Or then you just put "#!/bin/bash" in your shell script and forget about POSIX sh?
                This can be a bit more compatible with the BSDs if you use '#!/usr/bin/env bash' instead, provided bash is installed.
                Don't expect much and seldom disappointed.

                Comment


                • #18
                  Originally posted by skeevy420 View Post
                  or some Python person saying I'm not gonna use Pip because someone might not have the internet available.
                  The more likely scenario is that Corporate firewall / policy will prohibit it. Ultimately, I actually agree with this, it is probably a good thing... I just get to re-implement whatever it is.

                  Comment


                  • #19
                    Originally posted by creoflux View Post

                    The more likely scenario is that Corporate firewall / policy will prohibit it. Ultimately, I actually agree with this, it is probably a good thing... I just get to re-implement whatever it is.
                    I used example that because a lot of what Pip provides is in distribution repositories because of the corporate firewalls, Python being used in system tools, and whatnot. I just think limiting yourself to the bare minimum of something because someone might have to resolve dependencies becomes a little lame at some point...especially with Pip where you end up doing redundant work just to reimplement the wheel. But if someone is dumb enough to pay for that...cool...sounds like you have a sweet gig.

                    Comment


                    • #20
                      Originally posted by dirlewanger88
                      Shell scripts should be written in POSIX sh, unless there's a reason not to.
                      why should i write programs in obsolete language when my system shell is bash?

                      Comment

                      Working...
                      X