PDA

View Full Version : Question from beginner about exec family



MaximusGlory
May 29th, 2012, 08:14 AM
Hi. I am new to C programming on Ubuntu.

My question is, after forking a new process, which call from the exec family can I use to execute a file with options and any other related arguments - for instance, a command from the /bin directory? By accepting arguments from the command line, using argc and argv, I can execute commands, like 'ls' and 'date', with no options, using execlp. I was wondering which exec call to use if I wanted to execute something like 'ps aux'?

Thanks.

nothingspecial
May 29th, 2012, 01:43 PM
Thread moved to Programming Talk.

Bachstelze
May 29th, 2012, 03:12 PM
Have you read the manual page for execlp()?