Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running multiple C programs from a C program under Linux

I'm trying to learn a bit or 2 about process communication under Linux, so I wrote 2 simple C programs that communicate with each other.

However, it's a bit annoying to have to run them manually every single time, so I'd like to know is there a way to make a program that will run them both, something like this:

./runner program1 program2

I'm using latest Ubuntu and Bash shell.

like image 996
ioreskovic Avatar asked Dec 28 '22 05:12

ioreskovic


1 Answers

run.sh script

#!/bin/sh
./program1 & 
./program2 &

run command:

$sh run.sh
like image 149
Qian Avatar answered Jan 08 '23 02:01

Qian