On Mon, Dec 5, 2022, at 2:47 AM, Ulrich Windl wrote: > So basically the behavior is as documented (not a bug), but the design > decision was poor: > > declare a > a=b > > has a different semantic as > declare a=b > > which I consider to be bad.
You're free to think so, but this behavior is ubiquitous among
Bourne-adjacent shells and is not about to change.
% cat foo.sh
export foo=$(false)
echo "$?"
% bash foo.sh
0
% ksh foo.sh
0
% zsh foo.sh
0
% dash foo.sh
0
% yash foo.sh
0
--
vq
