Is it recommended to call shell commands from a C program in C using system() ?
I want to develop a web crawler in C and want to use wget to fetch content from a URL ?
Should I do it using system(” wget …”)?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Regardless of the programming language, calling system shell should really be the last resort when nothing else works, because:
The same
wgetwas a problem for us when we were porting some nasty perl code to mobile device. While just from Linux to Linux, we discovered that “standard”wgethas some switches BusyBox does not support so needed to portwgetas well, and later evengrepas if perl would not have its own pattern search. After that I am fully convinced that better no.