bug-sed
[Top][All Lists]
Advanced

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

bug#27200: sed happily modifies read-only files.


From: Péter
Subject: bug#27200: sed happily modifies read-only files.
Date: Tue, 6 Jun 2017 14:32:28 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1


I find it "interesting" that you do not see this as an erroneous behaviour.


That permission bit means that "do not overwrite [nor delete] it, ask the user first". Its purpose is to give (some degree of) protection. Every text editor, the mv command, rm command, all ask confirmation from the user (or simply refuses to overwriting or even modifying).
The "-f" switch which mv has, means "(this time I the user grants you:) do not ask, 
assume yes for the confirmation".
(And the "-n" switch means "do not ask, assume no for the confirmation".)

Only sed is which do not ask the user..

I gave no "--force" switch to sed, and yet sed assumes as if that were given.
Counterintuitive. Breaks the rules.



Assaf Gordon:
This is not a bug - just a sligthly wrong expectation of what
'write-protected' means.







reply via email to

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