Skip to content
  • Hjem
  • Seneste
  • Etiketter
  • Populære
  • Verden
  • Bruger
  • Grupper
Temaer
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Kollaps
FARVEL BIG TECH
  1. Forside
  2. Ikke-kategoriseret
  3. Today in "things I hate about bash" I found out that it is syntactically meaningful to have a space between your square braces and the operands inside

Today in "things I hate about bash" I found out that it is syntactically meaningful to have a space between your square braces and the operands inside

Planlagt Fastgjort Låst Flyttet Ikke-kategoriseret
5 Indlæg 5 Posters 8 Visninger
  • Ældste til nyeste
  • Nyeste til ældste
  • Most Votes
Svar
  • Svar som emne
Login for at svare
Denne tråd er blevet slettet. Kun brugere med emne behandlings privilegier kan se den.
  • foritus@toot.dusepo.co.ukF This user is from outside of this forum
    foritus@toot.dusepo.co.ukF This user is from outside of this forum
    foritus@toot.dusepo.co.uk
    wrote sidst redigeret af
    #1

    Today in "things I hate about bash" I found out that it is syntactically meaningful to have a space between your square braces and the operands inside

    if [["foo" != "bar"]]; then echo "yay"; fi
    # error, executable "foo" not found.
    if [[ "foo" != "bar" ]]; then echo "yay" fi
    # yay

    I hate bash.

    hypha@cafe.mycelium.locahlo.stH helenanne@mastodon.scotH mmeier@social.mei-home.netM reynir@social.data.coopR 4 Replies Last reply
    0
    • foritus@toot.dusepo.co.ukF foritus@toot.dusepo.co.uk

      Today in "things I hate about bash" I found out that it is syntactically meaningful to have a space between your square braces and the operands inside

      if [["foo" != "bar"]]; then echo "yay"; fi
      # error, executable "foo" not found.
      if [[ "foo" != "bar" ]]; then echo "yay" fi
      # yay

      I hate bash.

      hypha@cafe.mycelium.locahlo.stH This user is from outside of this forum
      hypha@cafe.mycelium.locahlo.stH This user is from outside of this forum
      hypha@cafe.mycelium.locahlo.st
      wrote sidst redigeret af
      #2

      @Foritus the only good reason to use it as a scripting language is because that’s the default shell almost everywhere ^^’

      1 Reply Last reply
      0
      • foritus@toot.dusepo.co.ukF foritus@toot.dusepo.co.uk

        Today in "things I hate about bash" I found out that it is syntactically meaningful to have a space between your square braces and the operands inside

        if [["foo" != "bar"]]; then echo "yay"; fi
        # error, executable "foo" not found.
        if [[ "foo" != "bar" ]]; then echo "yay" fi
        # yay

        I hate bash.

        helenanne@mastodon.scotH This user is from outside of this forum
        helenanne@mastodon.scotH This user is from outside of this forum
        helenanne@mastodon.scot
        wrote sidst redigeret af
        #3

        @Foritus a language that deliberately makes conditionals as difficult as possible.

        1 Reply Last reply
        0
        • foritus@toot.dusepo.co.ukF foritus@toot.dusepo.co.uk

          Today in "things I hate about bash" I found out that it is syntactically meaningful to have a space between your square braces and the operands inside

          if [["foo" != "bar"]]; then echo "yay"; fi
          # error, executable "foo" not found.
          if [[ "foo" != "bar" ]]; then echo "yay" fi
          # yay

          I hate bash.

          mmeier@social.mei-home.netM This user is from outside of this forum
          mmeier@social.mei-home.netM This user is from outside of this forum
          mmeier@social.mei-home.net
          wrote sidst redigeret af
          #4

          @Foritus Yupp. I'm pretty sure I'm doing this one at least once for every if I write. 🤦

          1 Reply Last reply
          0
          • foritus@toot.dusepo.co.ukF foritus@toot.dusepo.co.uk

            Today in "things I hate about bash" I found out that it is syntactically meaningful to have a space between your square braces and the operands inside

            if [["foo" != "bar"]]; then echo "yay"; fi
            # error, executable "foo" not found.
            if [[ "foo" != "bar" ]]; then echo "yay" fi
            # yay

            I hate bash.

            reynir@social.data.coopR This user is from outside of this forum
            reynir@social.data.coopR This user is from outside of this forum
            reynir@social.data.coop
            wrote sidst redigeret af
            #5

            @Foritus I think it goes back to bourne shell and [ foo = bar ] test "alias"

            1 Reply Last reply
            0
            Svar
            • Svar som emne
            Login for at svare
            • Ældste til nyeste
            • Nyeste til ældste
            • Most Votes


            • Log ind

            • Har du ikke en konto? Tilmeld

            • Login or register to search.
            Powered by NodeBB Contributors
            Graciously hosted by data.coop
            • First post
              Last post
            0
            • Hjem
            • Seneste
            • Etiketter
            • Populære
            • Verden
            • Bruger
            • Grupper