85
Amber the programming language compiled to Bash, 0.5.1 release
(docs.amber-lang.com)
A community for everything relating to the GNU/Linux operating system (except the memes!)
Also, check out:
Original icon base courtesy of lewing@isc.tamu.edu and The GIMP
Interesting. There is this example in the docs:
https://docs.amber-lang.com/basic_syntax/commands
How can we know for sure what failed here? Was it the cat or the grep? My instinct says the pipe returns the code of the last cmd or failure, which could be either.
Perhaps it's just a contrived example and it would be better to separate testing file existence from grepping in real code...
Yep, the code you provided is compiled into this:
So, 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.