LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-30-2003, 07:19 AM   #16
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 256Reputation: 256Reputation: 256

You know, you could always add to your script to remove the existing files in /home/trifon/rute and then cp the back up files, eh ?? Then they have nothing to overwrite.

Last edited by trickykid; 01-30-2003 at 07:21 AM.
 
Old 01-30-2003, 07:29 AM   #17
trubi
LQ Newbie
 
Registered: Jan 2003
Distribution: RedHat 7.3 (Valhalla)
Posts: 25

Original Poster
Rep: Reputation: 15
Ok maybe it's better but not enough
Here is the result
............

cp: overwrite `/home/trifon/rute/setup/main.html'? `/home/trifon/InterBase/setup/main.html' -> `/home/trifon/rute/setup/main.html'
...............

But it dosn't do the override !!!!
It doesn't put "y" after ?
 
Old 01-30-2003, 07:37 AM   #18
trubi
LQ Newbie
 
Registered: Jan 2003
Distribution: RedHat 7.3 (Valhalla)
Posts: 25

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by trickykid
You know, you could always add to your script to remove the existing files in /home/trifon/rute and then cp the back up files, eh ?? Then they have nothing to overwrite.

Yes that's the finall step but I wanted to make it with cp but ...
It seems like it won't happen with cp

Thanks to all for the help

 
Old 01-30-2003, 07:46 AM   #19
Darin
Senior Member
 
Registered: Jan 2003
Location: Portland, OR USA
Distribution: Slackware, SLAX, Gentoo, RH/Fedora
Posts: 1,024

Rep: Reputation: 45
some suggestions...

try a redirect like maybe one of these: not tested, not sure:
cp /foo/old/toast /foo/new/toast <yes
cp /foo/old/toast /foo/new/toast <"yes"

or try to dump one file into the other, as an example I sometimes use this command:
cat /home/storage/XF86Config > /etc/X11/XF86Config

Which dumps the contents of file1 but redirects it from the screen to file2, if the destination doesn't exist it usually makes it w/out prompting and the same thing with ovewriting. the only problem I can think of is I've only done this with text files, binaries may get trashed by the cat command.

-v will make cp or mv show more info so that's why it may prompt you for things it wouldn't without the -v...

Also have you tried the same command in a script? I know in DOS the copy and move commands behave differently when in a .bat file ala not prompting to overwrite files in some cases.
 
Old 01-30-2003, 08:34 AM   #20
Malicious
Member
 
Registered: Jan 2002
Location: Galveston Island
Distribution: suse, redhat
Posts: 208

Rep: Reputation: 30
At your shell prompt, type "alias". Odds are that there is an alias "cp=cp -i" in there somewhere. Either use unalias to get rid of it or use "/bin/cp x y". Typically, for root, mv, cp and rm are aliased with the "-i" to prevent fat finger errors.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Stupid Newbie with simple question... tufkid Linux - Newbie 11 12-25-2004 10:40 PM
Simple newbie question - how to... mazzo Linux - Wireless Networking 4 09-02-2004 03:34 PM
simple newbie question naijaguy Red Hat 1 08-11-2004 10:55 PM
Simple newbie question izrahi Linux - Newbie 1 08-11-2004 05:07 PM
Iptables newbie / simple question wr3ck3d Linux - Networking 2 03-06-2003 08:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration