Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Redirection (<>)



Jan Kroken wrote:
>What does <> really mean?

It does exactly what it says on the tin.  It opens the file for
input and output (mode O_RDWR), attaching it to standard input (file
descriptor 0).  It does absolutely nothing to standard output, or any
other file descriptor.

You could do "<>foo >&0" to make the same file available as standard
output as well, but the standard text utilities would be rather confused
by this.  It's more useful with character devices, where input and output
are largely separate operations, and there's no seek pointer to share.

-zefram



Messages sorted by: Reverse Date, Date, Thread, Author