|
|
Run the bash shell in su mode
bash and sh are actually the same binary.
Although for some reason it's two copies, rather than one symlinked or hard linked to the other:
(the first number is the inode number)
Run the bash shell in su mode
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?
Run the bash shell in su mode
It looks at the name of what's being executed (argv[0]) and makes its decision appropriately.
Run the bash shell in su mode
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.
broken hard links
I noticed that after installing one of the 10.3.x updates (.2 or .3) /bin/bash and /bin/sh were no longer hard linked, nor were other files in /bin and /usr/bin that previously had been. I'm convinced it's a side effect of installing certain dot-release updates (which I also noticed between some 10.2 releases), but it didn't happen with 10.3.1. My unconfirmed suspicion is that under certain conditions update_prebinding is responsible for making separate versions of system binaries that were originally hard linked. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.16 seconds |
|