Subject: bug#12365: Incorrect return value of cp with no-clobber option

From: Anoop Sharma <[email-masked]>
Date: Thu, 6 Sep 2012 17:27:52 +0530

When -n (--no-clobber) option of cp is used and the DEST file exists, then, as
expected, cp is not able to copy the SOURCE to DEST.

However, cp returns 0 in this case.

Shouldn't it return 1 to indicate that copy operation could not be completed?

In absence of this indication how is one to know that some recovery
action like re-trying cp with some other DEST name is required?

Regards,
Anoop