Closed leoheck closed 1 year ago
"-d" detaches from the running terminal, so it will fork/fork/setsid/exit. You should perhaps try running without "-d" and putting in background with "&" for use in interactive scripts
Ah, did not know that the daemon does not generate the $!
, thanks for the quick response.
Yeah, I agree the &
would work.
Since I did not think about that, I am currently using:
pgrep tty_fake -a | grep ${the_fake_tty} | cut -d" " -f1
which works fine, but it took me some time to figure out that the $! was not working.
Well, I think that's enough for me to close this issue. Thanks @danielinux
Hi, I am running this code:
The variable
$!
is giving me this PID31163
no matter what I do. But the actual value is different, this time it is31429
. Is there any reason for that? Is there a way to get the right PID straight from thetty_fake
command without having to process the ps command, for instance?