Subject: bug#17087: cp -i/yes gets ignored

From: [email-masked] (Karl Berry)
Date: Mon, 24 Mar 2014 16:17:33 GMT

I find it annoying that explicitly answering "y" to an interactive
prompt in cp can get ignored:

$ touch foo
$ chmod 444 foo
$ cp -i /etc/issue foo
cp: try to overwrite 'foo', overriding mode 0444 (r--r--r--)? y
cp: cannot create regular file 'foo': Permission denied

It seems to me, in terms of UI, that this is clearly at least as
"forceful" (I would say more so) than -f, which does do the overwrite.

Also, both mv -i and rm -i already perform their action on a readonly
file when told "y"es.  So simple consistency is another argument that cp
should do the same.

Jim told me once that this behavior is specified by POSIX.  Hardly
surprising.  Can we DTRT here by default and reserve the stupid behavior
for POSIXLY_CORRECT?

Curmudgeonly,
Karl