On Sun, Jan 29, 2017 at 7:04 AM, eryk sun <eryk...@gmail.com> wrote:
> Now let's get rid of the terminal via setsid:
>
>    $ echo spam |
>     > 2>&1 setsid python3 -c 'import os
>     > fd = os.open("/dev/tty", os.O_RDONLY)
>     > print(os.get_terminal_size(fd))' |
>     > cat
>     Traceback (most recent call last):
>       File "<string>", line 2, in <module>
>     OSError: [Errno 6] No such device or address: '/dev/tty'

And you could have achieved the same result in any number of other
ways, too, like setting yourself up with the local boot system (true
of systemd, upstart, sysvinit, and probably of all others too), or
cron, or inetd, etc, etc, etc. You can definitely lose access to your
"controlling terminal".

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to