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

  • gtrcoi@programming.dev
    link
    fedilink
    arrow-up
    3
    ·
    18 days ago

    I get why this is useful, and it’s useful for me as well, but the perfectionist in me asks why target bash instead of posix?

    • lens0021@programming.devOP
      link
      fedilink
      arrow-up
      3
      ·
      edit-2
      17 days ago

      Currently, Amber does not even support Bash 2 because Bash 2 does not support the += operator. (ticket) However, I believe that POSIX compliance is on Amber’s long-term milestone, and that it will eventually achieve this as its support range expands.

  • Samueru_sama@programming.dev
    link
    fedilink
    English
    arrow-up
    2
    ·
    17 days 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.