The manpage of cp says

     -f      For each existing destination pathname, remove it and create a
             new file, without prompting for confirmation, regardless of its
             permissions.  This option overrides any use of -i.

     -i      Write a prompt to the standard error output before copying a file
             that would overwrite an existing file.  If the response from the
             standard input begins with the character `y', the file copy is
             attempted.

but that isnot what cp actually does:

$ rm -f echo bar
$ echo new > foo
$ echo old > bar
$ cp -fi foo bar
overwrite bar? n
$ cat bar
old

Accoording to the manpage, the '-f' should have overrided the '-i'.
Instead, it asked for confirmation, which said 'n', and cp(1) did
not copy foo over bar, as it still has the old content.

        Jan

Reply via email to