I am writting a program that needs to parse argv as most programs do,
here is what I have:
while ((c = getopt(argc, argv, "q:") != EOF) {
switch (c) {
case 'q':
qname = optarg;
break;
default:
usage(); /* Usage will exit */
}
}
Here is argv[]: ./a.out -q test sleep 100000
I then want to fork/exec sleep 10000, how do I get sleep 1000 into a char **? Right now I can only see sleep.
-Tony
here is what I have:
while ((c = getopt(argc, argv, "q:") != EOF) {
switch (c) {
case 'q':
qname = optarg;
break;
default:
usage(); /* Usage will exit */
}
}
Here is argv[]: ./a.out -q test sleep 100000
I then want to fork/exec sleep 10000, how do I get sleep 1000 into a char **? Right now I can only see sleep.
-Tony