On Sat, Oct 02, 2021 at 06:06:32PM +0200, Léa Gris wrote: > Better illustrated how newlines are discarded: > > $ sudo bash -c 'echo hello > echo world' > > hello > > world > > $ sudo -i bash -c 'echo hello > echo world' > > helloecho world
OK, that's news to me. But that looks like a bug in sudo. Asking bash to change its behavior to work around a bug in some other program seems like misdirected effort. unicorn:~$ sudo ~greg/bin/args $'one\ntwo' three 2 args: <one two> <three> unicorn:~$ sudo -i ~greg/bin/args $'one\ntwo' three 2 args: <onetwo> <three> I wonder why it does that. It's not helpful in any situation I can think of. It's certainly not documented in the -i section of the man page.