bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: sed -i should require write access (was: Bug in sed)


From: John Cowan
Subject: Re: sed -i should require write access (was: Bug in sed)
Date: Tue, 28 Dec 2010 15:56:50 -0500
User-agent: Mutt/1.5.18 (2008-05-17)

Paul Eggert scripsit:

> Yes, but still, it's bogus that "sed -i" overwrites a read-only file.
> That's not what users expect, and it's not what the documentation says.
> The documentation says that -i "overwrites the file in place", which
> implies that you must have write access to the file.

I agree that allowing sed -i to "overwrite" a read-only file violates
the Principle of Least Astonishment.  I can see why it does so *on
reflection*, but it certainly isn't what I would expect, and I'm certainly
no newbie.

I don't consider breaking bug-for-bug compatibility with Perl
particularly important.  Perl does *lots* of astonishing things.
Backward compatibility *is* an issue, but it could be phased in by having
one release print a loud and obnoxious warning that this behavior will
stop working, and the next release actually remove it.

-- 
John Cowan              address@hidden          http://www.ccil.org/~cowan
Historians aren't constantly confronted with people who carry on
self-confidently about the rule against adultery in the sixth amendment to
the Declamation of Independence, as written by Benjamin Hamilton. Computer
scientists aren't always having to correct people who make bold assertions
about the value of Objectivist Programming, as examplified in the HCNL
entities stored in Relaxational Databases.  --Mark Liberman



reply via email to

[Prev in Thread] Current Thread [Next in Thread]