I am running an except script where it spawns a c program, waits for an output from the program, and then spawns another program. After that program has finished, I want to send to the original program that was first spawned, but I get the spawned id exp7 not open.
I then tried to get the value of the spawn_id before spawning a new process, but apparently, it is empty, since when I try to doset old_id $spawn_idI get the error saying that old_id is not defined.Do you have any tips on how to spawn a process, then spawn another process, and after that process has finished, to send something to the first process?
Code for the expect script
spawn ./practiceset id $spawn_idexpect "Enter:\r"spawn ./practice2expect eofset spawn_id $idsend "he"expect eof
The code in practice and practice2 doesnt make a difference, so I will not post them