Answer the question
In order to leave comments, you need to log in
How to protect a process from being interrupted on exit?
Good day!
I reformulated the question, because there was a lot of text: I'm doing a
lab. work on Unix - "process management" I run the
script:
$sh pr1
while((++i)); do echo $i » file.txt; sleep1; done
Answer the question
In order to leave comments, you need to log in
C nohup figured it out. After checking the output of nohup.out , I saw a bunch of errors there.
Because when creating the procedure, extended syntax was used, sh does not know it, you need to add a link to bash at the beginning of the procedure text :
#!/bin/bash
while ((++i))
do
echo $i » file.txt
sleep 1
done
Well, if I just do pr1 &, then the process goes into the background, you can't kill it by logging out - except by killing the shell (probably :)) ... If you start with nohup, when you "re-login" PPID =1 (init), TTY = ?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question