Why sh -c 'echo -n 1' is different from bash -c 'echo -n 1' I am on a Mac Book Air, OSX 10.8.

I am trying to understand why these two snippets do not print the same output.
sh -c 'echo -n 1' outputs -n 1 whereas
bash -c 'echo -n 1' outputs 1 as expected.

Could you help me explaining why and how to make them output the same (if at all possible)?
Because apparently Mac OS is one of the systems which responds to the xpg_echo option when run in POSIX mode. Running bash as /bin/sh is equivalent to running with either --posix or setting POSIXLY_CORRECT.

The solution is to stop using echo except in cases where there can be no ambiguity. printf is the portable replacement. Never use option flags to echo, (and use printf if you do).

There are multiple incompatible historical implementations of echo which break its specification in a way that can't be fixed, and the option flags are therefore non-portable. I'm not aware of anything that currently implements POSIX echo correctly.

shopt -u xpg_echo should modify this behavior. Also as you've already discovered, not running in POSIX mode.

Also you might want to upgrade... bash 3 is getting a little crusty. Many bugs have been fixed since.