[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ale] Arguments question






I would like to take simple programs and rename the main() function to the name of the simple program.?? I would then like to be able

to call them from one main program.?? Below is an example:




int
main(int argc, char argv[])
{
?????????????? if (strncmp(argv[0],"shell") == 0)
?????????????? ?????????????? shell(argv);


?????????????? return 0;
}


int
shell(int argc, char *argv[])
{
?????????????? /*


?????????????? ?????????????? Shell Code


?????????????? */


}


It seems simple, but my program that I am calling from main are not getting all the arguments.?? Maybe I've overlooked something.

Chris