Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Run the bash shell in su mode' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Run the bash shell in su mode
Authored by: rhowell on May 12, '04 04:27:52PM

If they're identical files then they should give identical output when they're run. They don't. They're doing something differently. How do they do that?



[ Reply to This | # ]
Run the bash shell in su mode
Authored by: wombat on May 12, '04 04:58:01PM

It looks at the name of what's being executed (argv[0]) and makes its decision appropriately.



[ Reply to This | # ]
Run the bash shell in su mode
Authored by: evansj on May 13, '04 09:53:28AM
Spot on. From the man page:
If bash is invoked with the name sh, it tries to mimic the startup behavior of historical versions of sh as closely as possible, while conforming to the POSIX standard as well.
There are a few specific behaviour changes documented in the man page, so man bash if you're interested.

[ Reply to This | # ]