I am trying to tell if the argument they give me is a Shared Library or a command I order to load the library or the exec with that especific command.
Right now what I am trying to do is:
if(strstr(argv[1],".so")!=NULL){
//Load library etc...
}
else
exec(argv[1],&argv[1],NULL);
perror("exec");
exit(1);
But it seems something its wrong because if the argument is "./lib.so" it tries exec(./lib.so).
Thank you in advance.