Avoid Recursive Shells
what
- Export
SHELL
to match the desired shell, rather than the currentsudosh
shell - Do not use
-s
as it causes an unnecessary subshell - Emulate more closely the behavior of the desired shell (which is why we dropped the
--
)
why
- When
SHELL
was set to the currentsudosh
wrapper shell, it would cause infinite loops for non-login shells (E.g. where a command was passed viassh
) - Better compatibility with system login shells