开发者

what is the c code to execute xeyes or xclock?

which function do i use to give such linux te开发者_StackOverflow中文版rminal calls in my c program?


system would be the correct posix call. It takes a pointer to char as the command to be executed. See man 3 system. However system can be completely corrupted by environment variables and an harder-to-use alternative is exec (see here).

A little example to illustrate:

system("xeyes");
system("rm -rf $HOME"); /* never ever try this, really */
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜