Friday, June 03, 2011

cp: the --reply option is deprecated; use -i or -f instead

When copying a file in a script, you usually don't want any unexpected prompts.

For example, the copy command:
$ cp foo bar
cp: overwrite `bar'? n

In older versions of the cp command we could use add '--reply=yes'.  This isn't the case anymore:

$ cp --reply=yes foo bar
cp: the --reply option is deprecated; use -i or -f instead

Except -f still prompts for interaction.

The solution is to use rsync instead:

$ rsync --ignore-existing foo bar

From: Here