1

Is there any way to execute Linux commands with c without using execlp(), like predefined functions or something else.

Thanks.

3 Answers 3

7

Use system() or popen() if you need the commands output.

Sign up to request clarification or add additional context in comments.

Comments

2

system(const char *command); sounds to be what you want

Comments

0

You can use system. It execute the command, but take care since it invoke a shell to interpret the command (breaking argument list on space, ...).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.