What is the functional difference between sudo su and sudo -i?Thanks. According to that, su changes HOME, USER, LOGNAME and SHELL. sudo su changes SUDO_COMMAND and USERNAME (to root) as well. If the shell of the user you're switching to is different to the current shell, it will have to start it, causing its rc file to run.

Is #!/bin/sh read by the interpreter?In Perl, if the interpreter is started directly (perl script.pl vs. ./script.pl) then the interpreter will read the shebang line to parse flags such as -w. It's not recommended to rely on this feature though.