Re: daemons, sockets and ssh
- From: Geoff Clare <geoff@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 14 Apr 2008 13:43:11 +0100
www.isp2dial.com wrote:
Use
</dev/null >/dev/null 2>&1
That makes sense.
or
<>/dev/null >&0 2>&1
But does it ever make sense to have 0 open for writing, or 1 and 2
open for reading?
It's very common. For example, a terminal session is usually set up by
opening the terminal on fd 0 read/write and then duping it onto 1 and 2.
The "more" utility actually takes advantage of this. If you execute
ls -l | more
on a terminal then "more" can't read its interactive commands (space
for the next page, etc.) from fd 0, so it first tries to read them
from fd 2. It will only resort to opening /dev/tty if fd 2 is
unreadable.
--
Geoff Clare <netnews@xxxxxxxxxxxxx>
.
- References:
- daemons, sockets and ssh
- From: Teo
- Re: daemons, sockets and ssh
- From: Barry Margolin
- Re: daemons, sockets and ssh
- From: Geoff Clare
- Re: daemons, sockets and ssh
- From: www . isp2dial . com
- daemons, sockets and ssh
- Prev by Date: Re: how to get TTY with SSH session
- Next by Date: Re: how to get TTY with SSH session
- Previous by thread: Re: daemons, sockets and ssh
- Next by thread: Query init runlevel?
- Index(es):
Relevant Pages
|