in reply to Inconsistent system call from backticks vs system()

Both backquotes and system should pass their argument to the shell, which will do the same thing with that. Therefore they should not behave differently up to the point where the command has started up.

This suggests to me that the difference in behaviour is in the external command itself. One wild guess is that the external command is testing whether or not it is talking to a tty, and then dying if not? (And then a poorly written error-report somewhere along the chain is lying to you about what is wrong...) You can check this by seeing if it will refuse to let its output be piped into another program. If this is the problem, you should be able to fix the problem with Expect or the older Comm.pl library. (You might have to dig around for a version/variation that will work on 5.004_04.)

Good luck...

  • Comment on Re: Inconsistent system call from backticks vs system()