Try tracing the program's execution with strace or truss to see what's happening differently between the two.
It's possible that something in the script is detecting that it's run from the command-line (by noticing that STDIN is a terminal) and doing it's work in the background, or something like that.
In reply to Re: exec vs. backtick-and-assign performance
by sgifford
in thread exec vs. backtick-and-assign performance
by apotheon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |