Without additional information, my suspicion would be that system() is invoking /bin/sh to execute your command, and that /bin/sh does not provide a 'history' built-in.
Another alternative may be that system() is invoking your shell in non-interactive mode, and the commands that you are trying to use only exist in interactive mode, or only provide the expected output in interactive mode.
In reply to Re: help on system function
by MarkM
in thread help on system function
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |