Re: Why does 'cp -f' not work anymore?

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

 



On 02Nov2005 11:04, Chris W. Parker <cparker@xxxxxxxxxxxx> wrote:
| Cameron Simpson <mailto:cs@xxxxxxxxxx>
|     on Tuesday, November 01, 2005 4:32 PM said:
| > Even easier is to quote just one character instead of the whole word:
| >   \cp -f newfile.txt this-has-to-go.txt
| 
| I've sinced just changed the original alias to be only 'cp' (although I
| guess I might as well get rid of the alias altogether...).

That'd what I do.

| But what I'm finding now is that it's not confirming an overwrite at all
| now.

Nice, isn't it?

| Originally the problem was that even 'cp -f' resulted in an overwrite
| confirmation. What I want to happen is that 'cp' will ask me for
| permission to overwrite and 'cp -f' will not. Is that possible?

No, unless you write another alias or shell function yourself.

| Or do I
| just have to remember to type 'cp -i'?

Yes.

| Am I making sense?

For some definition of the term, yes.
How about this:

	# just in case - ick!
	unalias cp

	# define smarter wrapper
	cp()
	{ [ "x$1" = x-f ] || set -- -i ${1+"$@"}
	  command cp "$@"
	}

This should turn on -i mode if you don't supply a -f.

Cheers,
--
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

The code was willing,
It considered your request,
But the chips were weak.
- Haiku Error Messages http://www.salonmagazine.com/21st/chal/1998/02/10chal2.html

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux