Fish is my main shell of choice and I use my self-written functions(https://github.com/lens0021/Lens0021_Personal.Fish/blob/main/conf.d/lens0021_personal.fish) daily. But it is hard for me to say Fish's syntax is not weird. Especially, I'm a little fuzzy on how to use argparse. I am sorry.
lens0021
joined 2 months 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.
tbh, I wouldn't recommend that during alpha staging. There are still many bugs.
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"
fi
So, the outcome would depend on the pipefail option. (set -o pipefail)
As you suggested, an Amberic snippet would be:
import { file_read } from "std/fs"
import { match_regex } from "std/text"
const result = file_read("file.txt") failed {
echo "Failed to read the file"
}
if match_regex(result, "READY"):
echo "file.txt contains READY"
Thank you for this comment. I'm revisiting this comment because I need to write this...
collapsed inline media