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

Re: <> redirection and notations



> I was mistaken when I said that <> truncated files in ksh. (Maybe it does
> in bash?

It doesn't.  The version of bash that Arnold has opens it O_RDWR; I
just changed that yesterday to O_RDWR|O_CREAT.

Some experimentation with `strace' and ksh shows that ksh also opens the
file O_RDWR|O_CREAT.

O_RDWR|O_CREAT is the right thing.  No shell that I know of has ever used
O_TRUNC with <>.

Chet

--
``The ballpark is quiet now, save for the sound of droplets landing.  That
  is as it should be.  For today there are two fewer boys of summer.''

Chet Ramey, Case Western Reserve University	Internet: chet@po.CWRU.Edu