Bash on OS X is always so old that I finally decided to compile a never(4.3.18) one and simply override and replace the old one.
Here are the configure flags I used:
./configure --prefix=/ --datarootdir=/usr/share
After installing this, I made a symlink:
/bin/sh -> bash
Everything worked well, except for man. Other manpages also has such problem.
apple [ ~ ] $ man bash
Error executing formatting or display command.
System command (cd '/usr/share/man' && (echo ".ll 14.0i"; echo ".nr LL 14.0i"; /bin/cat '/usr/share/man/man1/bash.1') | /usr/bin/tbl | /usr/bin/groff -Wall -mtty-char -Tascii -mandoc -c | (/usr/bin/less -is || true)) exited with status 32512.
No manual entry for bash
However everything is fine if I simply execute the command mentioned above:
apple [ ~ ] $ (cd '/usr/share/man' && (echo ".ll 14.0i"; echo ".nr LL 14.0i"; /bin/cat '/usr/share/man/man1/bash.1') | /usr/bin/tbl | /usr/bin/groff -Wall -mtty-char -Tascii -mandoc -c | (/usr/bin/less -is || true)
And I got the regular and correct output, which is the new manpage.
Well, All this was caused by the symlink...
I don't know why it disappeared. Anyway, Everything went well after I relinked it.