#include #include #include #define LEN 128 #define USE_LIB 0 int main(int argc, char ** argv) { FILE *flist; if (argc < 2) return 1; flist = fopen(argv[1], "r"); char cmd[LEN]; while(fgets(cmd, LEN, flist)) { if (USE_LIB) { system(cmd); continue; } if (!fork()) { execl("/bin/sh", "sh", "-c", cmd, (char *) NULL); } else { sleep(3); } } return 0; }