With bash, for example, one can pass the --norc --noprofile flags to prevent the reading of shell initialization files.
What's the equivalent for sh?
If there isn't one for sh, is there at least one for dash?
(I've tried hacks based on temporarily unsetting HOME, but they seem to be too fragile for production work.)
--norcwouldn't be needed, and is in fact ignored bybashwhen started with the namesh). I don't think there is anyway to prevent a login shell from sourcing/etc/profile, though. – chepner Sep 10 '15 at 20:42Invocation. How does it detect that it is a non-interactive shell? – ott-- Sep 10 '15 at 21:00