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
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
Yep, the code you provided is compiled into this:
command_0="$(cat file.txt | grep "READY")" __status=$? if [ "${__status}" != 0 ]; then echo "Failed to read the file" fiSo, the outcome would depend on the
pipefailoption. (set -o pipefail)As you suggested, an Amberic snippet would be:
Thanks for that, makes sense. I like that Amber gives the ability to code more defensively/robustly where appropriate but can also get out the way if you just need to run a bunch of BASH raw.