bug-coreutils
[Top][All Lists]
Advanced

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

cp -u should skip copying a file to itself


From: Ed Avis
Subject: cp -u should skip copying a file to itself
Date: Sat, 4 Oct 2008 17:02:13 +0100 (BST)

% touch foo foo
% cp -u foo foo && echo yes
cp: `foo' and `foo' are the same file

I expected that since -u says

       -u, --update
              copy only when the SOURCE file is newer than the
              destination file or when the destination file is missing

it would not attempt to copy the file in this case (since the file is not newer than itself) and cp would return a true exit status.

--
Ed Avis <address@hidden>





reply via email to

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