Hello,
I have a shell program with a function that handles external unix calls, but I can't figure out how to make it so I can use an exec call because the amount of arguments being sent to the function is different for different external commands...
int exCmdhandler(char* cmd, char* args[]){...
Hello,
I'm trying to print out the user's name, but am receiving an error:
------
struct passwd* user = getpwuid(getuid());
printf("\n %s \n", user.pw_name);
---------
the error I receive is:
request for member "pw_name" in something not a structure or union
-----
I'm...
What I'm trying to do is have my program make an execlp call and then return back to my original program...
I know that I can use fork to create another process..and that exec will replace the process that it is being called from...but i'm not sure exactly how to use fork and wait and exec...
Thank you for the reply Salem,
Follow up question:
How can I capture the string data from calling the uname() function? It returns an integer, so I'm not quite sure how to do this...
Thanks
I'm quite new to the C language, and i'm sure this is a simple question...
I'm trying to create a prompt that includes the output from the command uname(), but I'm having trouble displaying it properly.
My question is how do I capture the output of the uname() command so I can include it in...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.