why sudo -s ‘printf "xx"’ cannot handle newline?

When calling the following command directly, the newline can be printed correctly.

printf "abc

But when calling it with sudo -s, the newline is ignored.

sudo -s "printf 'abc

The $SHELL is using bash.

Source: shell

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.