I realize that the OP has solved their problem, but I just wanted to point something out to other people who may be reading this thread.
Using the system() function is really only good practice if you don't intend for your program to be cross-platform. Since system() essentially just passes a string to the system shell for it to parse, then a program that has bash commands in a system() call will only work on systems that use bash as the main shell. The most obvious problem with this is that, well, not all systems use bash as their main command shell (especially not Windows), and so you'll get errors if you try to run the same program with the same system() calls on a system with a different CLI shell.
I'm not trying to criticize the OP's use of the function...if it's for something private, then that's fine. I was just pointing out that you really shouldn't use the function in all cases.
Last edited by MrCode; 03-09-2010 at 04:08 PM.
|