coreutils
[Top][All Lists]
Advanced

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

Re: cp without overwriting files but printing warning messages automatic


From: Peng Yu
Subject: Re: cp without overwriting files but printing warning messages automatically?
Date: Sun, 10 Mar 2013 05:03:11 -0500

On Sun, Mar 10, 2013 at 3:37 AM, Henrik Juul Pedersen
<address@hidden> wrote:
> Hi Peng Yu,
>
> On Sun, Mar 10, 2013 at 5:58 AM, Peng Yu <address@hidden> wrote:
>
>> Hi,
>>
>> -i can prompt warning messages. But I have to type n to avoid
>> overwriting files. I found 'yes' to print 'y' repetitively. Is there
>> something I can use to cp without overwrite files but with warning
>> messages printed automatically?
>
>
> From the cp manual:
>
>        -n, --no-clobber
>               do not overwrite an existing file (overrides a previous -i
> option)
>
> Does this answer your question?

It does not print any warnings. I need the warnings (e.g., b.txt could
be overwritten if -n were not used) be printed.

echo a > a.txt
echo b > b.txt
cp -n a.txt b.txt


-- 
Regards,
Peng



reply via email to

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