Re: "> /dev/tty$i" commands in /etc/rc.sysinit?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 30 Nov 2004 20:37:23 +0800, John Summerfield
<debian@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> On Tuesday 30 November 2004 20:18, Andrei Nestor wrote:
> > "> file" is equivalent to "cp /dev/null file", which means the
> > contents of the file is cleared
> > probably those lines are there to clear the ttys before spawning a
> > login prompt on them.
> 
> I don't think that writting nothing on the ttys actually does that.
> 
> clear >/dev/tty$i possibly would (if TERM was set properly).
> 
yes, it seems that what i said was just part of what > file does:
the following is from the bash man page


   Redirecting Output
       Redirection  of  output  causes  the  file  whose name results from the
       expansion of word to be opened for writing on file descriptor n, or the
       standard output (file descriptor 1) if n is not specified.  If the file
       does not exist it is created; if it does exist it is truncated to  zero
       size.

       The general format for redirecting output is:

              [n]>word

       If  the  redirection operator is >, and the noclobber option to the set
       builtin has been enabled, the redirection will fail if the  file  whose
       name  results  from the expansion of word exists and is a regular file.
       If the redirection operator is >|, or the redirection operator is > and
       the  noclobber  option  to  the set builtin command is not enabled, the
       redirection is attempted even if the file named by word exists.

so,  the specified tty is opened for writing on file descriptor 1 (stdout)

-- 
andrei

P.S.: OS/400 Rulez.


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux