[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-bash] Command run in the background (with '&' at the end) still ru
From: |
Peng Yu |
Subject: |
[Help-bash] Command run in the background (with '&' at the end) still runs even when the user exit from the login shell? |
Date: |
Thu, 12 Dec 2013 16:53:43 -0600 |
Hi,
My previous impression was that processes run with '&' will be
automatically terminated once the user logs out. But I just checked
with the following example, it seems that these processes will
continue to run until finished.
Had bash ever terminated processes run with '&' before upon user
logging out? Or there is some other shell that has this behavior?
Thanks.
/test/bash/man/operator/&$ cat infiniteloop.sh
#!/usr/bin/env bash
while true
do
date > /tmp/infiniteloop.txt
sleep 1
done
/test/bash/man/operator/&$ ./infiniteloop.sh &
[1] 28300
/test/bash/man/operator/&$ exit
logout
/tmp$ cat infiniteloop.txt
Thu Dec 12 16:52:00 CST 2013
/tmp$ cat infiniteloop.txt
Thu Dec 12 16:52:41 CST 2013
--
Regards,
Peng
- [Help-bash] Command run in the background (with '&' at the end) still runs even when the user exit from the login shell?,
Peng Yu <=