Using a Single system() Call to Execute Multiple Commands in C

前端 未结 3 675
攒了一身酷
攒了一身酷 2020-12-03 18:51

In an information security lab I\'m working on, I\'ve been tasked with executing multiple commands with a single call to \"system()\" (written in C, running on Fedora). Wha

3条回答
  •  没有蜡笔的小新
    2020-12-03 19:11

    One possibility comes immediately to mind. You could write all the commands to a script then run it with:

    system ("cmd.exe /c \"x.cmd\"");
    

    or, now that I've noticed you're running on Fedora:

    system ("x.sh");
    

提交回复
热议问题