问题描述
我企图学习有关Linux下进程通讯的知识,所以我写了2个相互通信的简单C程序.
I'mtryingtolearnabitor2aboutprocesscommunicationunderLinux,soIwrote2simpleCprogramsthatcommunicatewitheachother.
然而linux标准教程,每次必须自动运行它们有点可恶c语言 运行 linuxc语言 运行 linux红旗linux系统,所以我想晓得是否有一种方式可以制做一个可以同时运行它们的程序,如同这样:
However,it'sabitannoyingtohavetorunthemmanuallyeverysingletime,soI'dliketoknowisthereawaytomakeaprogramthatwillrunthemboth,somethinglikethis:
./runner program1 program2
我正在使用最新的Ubuntu和Bashshell.
I'musinglatestUbuntuandBashshell.
推荐答案
run.sh脚本
#!/bin/sh
./program1 &
./program2 &
运行命令:
$sh run.sh
904