Getting the rom name and emulator
-
@sano Here is a way to prove what I said:
[PROMPT]$ cat father.sh #!/bin/bash echo "FATHER: Hello, I am the father." echo "FATHER: Hey son, say hello to the world!" bash son.sh & sleep 10 echo "FATHER: Oh no! I am going to die! NOOOOOoooooo..." sleep 1 echo "FATHER: bye!" exit [PROMPT]$ cat son.sh #!/bin/bash while true; do echo "SON: Hello World!" sleep 2 done [PROMPT]$ bash father.sh FATHER: Hello, I am the father. FATHER: Hey son, say hello to the world! SON: Hello World! SON: Hello World! SON: Hello World! SON: Hello World! SON: Hello World! FATHER: Oh no! I am going to die! NOOOOOoooooo... SON: Hello World! FATHER: bye! [PROMPT]$ SON: Hello World! SON: Hello World! SON: Hello World! SON: Hello World! SON: Hello World! SON: Hello World! SON: Hello World! SON: Hello World! ...
-
-
@meleu @cyperghost
My bad then, you're right of course ;)Edit : my guess would only be valid (I think) if the user launching the script disconnects afterward, which is not the case here.
I was probably misled by the statement that the scrolling stops when the game launch.
It was late here anyway, I was drunk, and my cat was distracting me.
Well, enough justifications I think. I'm just obviously no good at this :) -
-
@cyperghost @Sano
One more note: theinit
process (the famous "PID 1") is the orphanage. When a parent process dies, its orphan children are "adopted" byinit
.Play a little with that father & son example and check the process table with the
ps -alf
. Look at the PPID column of theson.sh
process before and after thefather.sh
's death. ;) -
-
@cyperghost said in Getting the rom name and emulator:
@meleu I see, so the PID changes after the father is dead. So it's necessary to check PID during run if I want to elemenate son.sh
No, no! What changes is the PPID (Parent's PID)! The PID never changes!
-
@meleu Thank you for clearance. But is the PPID in any way important or is there a usecase? (maybe dumb question?)
EDIT:
Answered myself. The PPID gives relationship of calls so you always know which programm started process x or process y. Helpfull indeed! -
@cyperghost it's not a dumb question at all :)
You can commit a genocide with a Parent's PID.
If a father's PID is 123, you can kill it and all its descendants with
kill -9 -123
But you wouldn't do such villainy, would you?
-
@meleu > But you wouldn't do such villainy, would you?
Only if the father is a really bad guy and his children are ramparts. But for all time: Peace and Harmony!
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.