[Toybox] Endless shell corner cases.

Rob Landley rob at landley.net
Thu Apr 16 06:12:31 PDT 2020


bash is doing:

  $ bash -c 'echo 2>blah.txt ${}'
  bash: ${}: bad substitution

because the ${} is processed before the 2>blah.txt so stderr isn't redirected
yet, but toysh is processing arguments in sequence so it doesn't start to expand
${} until it's already redirected stderr, so the text winds up in blah.txt.

I think I'm ok with that? We're not matching bash's behavior exactly here, but
toybox's code is simpler and I don't want to add a seperate pass for this to
match the sequencing?

Rob



More information about the Toybox mailing list