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@programming.dev
    link
    fedilink
    English
    arrow-up
    3
    ·
    8 hours 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.