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

    • BB_C@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      16 hours ago

      They know you can just do if ((age < 18)) in bash, right?

      Or rather if ((10#$age < 18)) because age=021 would not be adult 😉 Hopefully, they protect against that at least.

      (I had to double-check this stupid default is still a thing, since I moved to zsh many years ago.)

    • Samueru_sama@programming.dev
      link
      fedilink
      English
      arrow-up
      1
      ·
      17 hours ago
      [ "$age" \< 18 ] && {
      	echo "I'm not an adult yet"
      } || {
      	echo "I'm an adult"
      }
      

      if you want to be using braces in if statements lol