Bash-like scripting in shells is prevalent in operating systems but I don’t understand why, when it doesn’t have the syntax to make programming easy like other languages. What features does bash have that make it so suitable for shells? Why even new operating systems like Redox OS choose a very similar syntax over a completely different programming language?

  • 𝘋𝘪𝘳𝘬@lemmy.ml
    link
    fedilink
    arrow-up
    18
    arrow-down
    2
    ·
    1 year ago

    What features does bash have that make it so suitable for shells?

    You mean, except being automatically available in basically every Linux distribution without having to install any additional software?

    • HeavyRust@lemm.ee
      link
      fedilink
      arrow-up
      6
      ·
      1 year ago

      They’re asking why it became available everywhere.

      Bash-like scripting has become ubiquitous in operating systems, and it makes me wonder about its widespread adoption despite lacking certain programming conveniences found in other languages.

      • ffhein@lemmy.world
        link
        fedilink
        arrow-up
        8
        ·
        1 year ago

        Because other languages available at that time lacked certain programming conveniences found in bash :) Despite its shortcomings, it’s still a very convenient language for running other programs, working with files, and piping output from one program to another, or to a file. Bash was first released in 1989, and I don’t know exactly when it passed the threshold for widespread adoption, but I can’t think of anything that would’ve been a better alternative.

        I think OP is also asking “why aren’t people switching to something else now” which is a completely different question.

      • 𝘋𝘪𝘳𝘬@lemmy.ml
        link
        fedilink
        arrow-up
        0
        arrow-down
        1
        ·
        1 year ago

        Because it’s automatically available in basically every Linux distribution without having to install any additional software.

          • maegul (he/they)@lemmy.ml
            link
            fedilink
            arrow-up
            4
            ·
            1 year ago

            yea … for me, until proven otherwise, I’m thinking bash + *nix shell ecosystem is basically a COBOL that isn’t cool to make fun of (yet?).

            All of the bash apologia I see whenever it comes up is not really encouraging. I get it, it’s got some handy features, but overall it’s clearly suboptimal for many, and that we keep on using because we’ve been keeping on using it but convince ourselves it’s good/cool … is not healthy.

          • 𝘋𝘪𝘳𝘬@lemmy.ml
            link
            fedilink
            arrow-up
            3
            arrow-down
            1
            ·
            1 year ago

            Because it was easily possible to become ubiquitous, because, well, what I said.

            There really is no other reason. Bash scripting is slow and lacks a lot of features. But it simply works.

          • Frater Mus@lemmy.sdf.org
            link
            fedilink
            arrow-up
            1
            ·
            1 year ago

            So it became ubiquitous because it was ubiquitous.

            IMO it became ubiquitous because it was a superset of the already-ubiquitous Bourne shell.