Ruunning Script from inside the Code

Hi All
I have this question if somebody can help me with an idea

Q1) Iam running QNX 6.2.1 for PowerPC. Iam in a situation now where do I need to start or call and run a script file (ie .sh) from inside the C code , is there a way I can do that.

Q2) now my program is written that all drivers will be loaded when the QNX boots up or starts running on the target. is there a way I can call certain drivers just when a certain program needs it.

Thanks all for help


Q1) system(“sh”);

Q2) int fd; if ((fd=open("/dev/mydevice",0))==-1) system(“mydriver &”); else close(fd);

Thanks very much for the reply