I'm working with robotics and we have had problems for run specific .exe while another (specific, too) .exe is runing. So, we want to kill all 'problematic' binaries before calling another one. For this purpose, I made an script with kill, but what I need is to make something like that:
While(The robot is on){
if(A problematic binary was called)
Call the script to kill all problematic binaries that are running now
Run the called binary
}
I've already mapped the 'problematic' binaries, so the problem is just how to make this loop run all the time.
Thank You All!!
PS: I'm using Ubuntu 18.04
edit: Sorry for my unclearness, I'll try to be more clear. It's something like that:
I have: A list of different binaries that we use, say: Walk , Run , Jump Let's say, for example, that when a call ./Run and, after that, I call ./Walk without stopping the last binary, the system crashes. The same occurs when calling ./Walk before ./Run But I have no problems when calling ./Jump
What I want is:
When calling ./Run -> Verify if ./Walk is running and kill it before running ./Run When calling ./Walk -> Verify if ./Run is running and kill it before running ./Walk
While(The robot is on){
if(A binary of the list,Walk or Run, is called)
Kill all the binaries of the problematic list
Run the called binary
}
while(robot_is_on)
? or you're looking for how to implementwhile true
?run
,walk
, andjump
are subcommands of arobot
binary, which manages its state internally.