Ee Aa
Ee Aa

Reputation: 1

Linux execlp in C++

It is my first time with Linux, and I need to use this

execlp("/usr/bin/wget", "wget", <URL STRING1>, NULL) system call in C++ code,

I cannot find anywhere how it should be written in C++, need some help.

Thank you!

Upvotes: 0

Views: 2181

Answers (2)

J-16 SDiZ
J-16 SDiZ

Reputation: 26910

Include the unistd.h

#include <unistd.h> 

int main() {
    execlp("/usr/bin/wget", "wget", "http://www.google.com", NULL);

    return 0;
}

Upvotes: 1

mvds
mvds

Reputation: 47034

execl("/usr/bin/wget","wget","http://stackoverflow.com/",NULL);

should do the job.

Upvotes: 1

Related Questions