My primary use case for Amber is when I need to write a Bash script but don’t remember the silly syntax. My most recent Bash mistake was misusing test -n and test -z. In Amber, I can just use something == "" or len(something) == 0

  • Samueru_sama
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 month ago

    My most recent Bash mistake was misusing test -n and test -z. In Amber, I can just use something == “” or len(something) == 0

    test -n can be [ "$something" ] and test -z can be [ "$something" = "" ]

    And this applies to posix shell, not just bash.

    • lens0021OP
      link
      fedilink
      arrow-up
      1
      ·
      1 month ago

      Thank you for this comment. I’m revisiting this comment because I need to write this…

      Comparing strings in a github actions workflow