Eric Blake wrote:
> Takahashi Mamoru wrote:
> > $ touch a; chmod 0444 a; ls -l a
> > $ /bin/rm -v a 0<&-
> > removed 'a'
> 
> This is undefined behavior, per POSIX (starting ANY application with
> stdin closed is undefined; in some cases, the OS may choose to start the
> app with stdin pointing to /dev/null instead of being closed, but you
> can't rely on that happening).  But the answer is the same whether stdin
> remains closed by the OS or whether it was opened to /dev/null - either
> way, stdin is not interactive.
> 
> > Is this a bug or a feature ?
> 
> Feature, mandated by POSIX (arguably an odd requirement, but it matches
> historical practice that people have come to rely on, so we can't change
> it).  Therefore, I'm closing this as not a bug, although you should feel
> free to reply if you have further comments or questions.

It is a feature.  If that were changed then many cron tasks would
start emitting email.  Arguably people should be putting 'rm -f'
instead of simply 'rm' in cron scripts but often they don't.

Bob



Reply via email to