It seems these should both make one line "+ a=b c=b" output, for s in sh bash do $s -xc 'a=b c=$a' done
I mean they give the same results, but bash splits it into two lines, so the user reading the bash -x output cannot tell if one (correct) or two (incorrect) lines were used. They can tell with sh -x. By the way, I looked up and down the man page, and wasn't sure if it says one should expect $c to end up as c= or c=b in fact! And I'm not sure the man page says to expect two lines or one of -x output either, when using sh vs. bash.