3 ms·
>no local variables They're not standard, so don't use them. Instead I often find a subshell to be sufficient. You can declare a function like so: my_func
by Sir_Cmpwn 8y ago
>no local variables
They're not standard, so don't use them. Instead I often find a subshell to be sufficient. You can declare a function like so:
my_func() (
local_variable=10
echo $local_variable
)
This is also a good strategy for helping you make purer shell functions.
>no process substitution, so one has to use temp files, temp named pipes or possibly joggle fd numbers
I don't find myself doing this often enough to care. It is possible, and if you're writing something which heavily relies on this perhaps you're better off with Go or Python.
>set -o pipefail
I agree, we've been talking to the Austin Group about getting this standardized.
I think we should go further, too, not by attempting to replace the shell with something that tries to do shell scripts better, but by making full-blown programming languages in which shell things are nicer to use.