0

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!

jogojapan
  • 68,383
  • 11
  • 101
  • 131
Ee Aa
  • 1
  • 3

2 Answers2

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

should do the job.

mvds
  • 45,755
  • 8
  • 102
  • 111
1

Include the unistd.h

#include <unistd.h> 

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

    return 0;
}
J-16 SDiZ
  • 26,473
  • 4
  • 65
  • 84