LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 03-18-2008, 09:47 AM   #1
maprice
LQ Newbie
 
Registered: Mar 2008
Posts: 1

Rep: Reputation: 0
Having trouble with cp command in my script.


Hello I知 having problems with what I知 sure should be a simple problem. I知 new to scripting so please be gentle.

I have this bit of script:

find / \( -iname "*.${file1}" -o -iname "*.${file2}" -o -iname "*.${file3}" -o -iname "*.${file4}" -o -iname "*.${file5}" -o -iname "*.${file6}" -o -iname "*.${file7}" -o -iname "*.${file8}" -o -iname "*.${file9}" -o -iname "*.${file10}" \) -exec cp {} /home/knoppix/files/ \;

Basically it is supposed to search the computer for certain file types and copy them to /home/knoppix/files/ The problem I have is that it finds the files and copies them but they all appear to be zero in size. Can anybody tell me what I知 doing wrong?

Thanks

Mark
 
Old 03-18-2008, 01:37 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
You may have to add the -t argument to cp: -exec cp -t {} /home/knoppix/files/ \;
 
  


Reply



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
Having trouble with a simple script Arcturuss Linux - Newbie 1 12-03-2007 01:10 AM
Trouble with script and bc Freestone Linux - General 4 10-11-2006 06:10 PM
having trouble with a intall script dexterwy Linux - Software 1 06-03-2005 10:22 AM
Trouble in Shell Script Gerardoj Linux - General 6 12-02-2003 09:21 PM
imwheel and script trouble Toker Linux - General 8 10-06-2003 02:26 AM

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

All times are GMT -5. The time now is 02:03 PM.

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