Shell's 'echo' and 'eval' have the same issue. They just dumbly concatenate their arguments with a space!
In https://www.oilshell.org, the simple_echo and simple_eval_builtin options make it so that echo and eval accept ONLY one argument. This means you have to use this style:
echo $x $y # illegal
echo "$x $y" # allowed since it's a single argument
write -- $x $y # legal and respect explicit separator
There's a separate "write" builtin that is more sane because we avoid changing the behavior of existing builtins, even when there is an option set.
This is also illegal when there's word splitting, but Oil doesn't have it (it turns on simple_word_eval [1] and simple_echo_builtin at the same time):
echo $x
This ssh behavior is probably of the same vintage. Since it's an external comand, the best we could do it wrap it with "myssh" or something similar, which doesn't have this pitfall.
In https://www.oilshell.org, the simple_echo and simple_eval_builtin options make it so that echo and eval accept ONLY one argument. This means you have to use this style:
There's a separate "write" builtin that is more sane because we avoid changing the behavior of existing builtins, even when there is an option set.This is also illegal when there's word splitting, but Oil doesn't have it (it turns on simple_word_eval [1] and simple_echo_builtin at the same time):
This ssh behavior is probably of the same vintage. Since it's an external comand, the best we could do it wrap it with "myssh" or something similar, which doesn't have this pitfall.[1] http://www.oilshell.org/blog/2021/04/simple-word-eval.html