You may also find this
old chestnut of an article useful. I suspect a few things may have been fixed since it was written, but it's worth being aware of them.
Also: Did you realize that executing a Unix script flies in the face of "platform-independence"? You might be better off to write a program that takes the
output of a Unix script and does something with it.
Winston