bug-coreutils
[Top][All Lists]
Advanced

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

Re: system ask user confirmation with cp -f


From: Eric Blake
Subject: Re: system ask user confirmation with cp -f
Date: Fri, 04 Sep 2009 07:38:06 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to YOGESH PATANKAR on 9/4/2009 7:23 AM:
> 1. Create a file i.e bdlist.txt in tmp directory.
> 2. Create a file with same name in root directory.
> 3. Execute command cp -f bdlist.txt /tmp
>  
> Error : System ask for confirmation from user. I think with -f option it 
> should overwrite directly.

You are probably suffering from an alias installed by your distro (this
behavior sounds like what would happen if you do alias cp='cp -i').  This
surprising behavior is why I personally recommend setting alias names to
something different than the POSIX tool name.  Try '\cp -f' to see if the
behavior matches your expectations.

At any rate, POSIX specifies that cp -f does not override -i - we are
still required to ask for a prompt, even though you added -f:
http://www.opengroup.org/onlinepubs/9699919799/utilities/cp.html

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqhGD4ACgkQ84KuGfSFAYCBzQCdHe150o6lnQKNNPcZlbE1/e5e
fGwAoMEx2PR6pEPKFIqOdlTPwSB1TDBE
=waKF
-----END PGP SIGNATURE-----




reply via email to

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