Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Query regarding find command in perl

Posted on 2003-02-27
6
Medium Priority
?
300 Views
Last Modified: 2011-09-20
hi
I am relatively new to perl scripting
I just wanted a help from you
I writing a perl script which backup all the files ending with txt of the users in the network
I am working on unix machine

how do i write a code equivalent the below unix command

find . -name '*.flt' -exec cp {} ./$HOME/backup \;

please give some suggestions or any hints...
I have tried using the command
system "find . -name '*.flt' -exec cp {} ./$HOME/backup \;"; in the perl script
but it gives error  "missing argument to `-exec'"

Please help me out......
Thanking you

Regards

Sagar Sirdesai
0
Comment
Question by:sagar24
5 Comments
 
LVL 48

Expert Comment

by:Tintin
ID: 8039466
Why do you want to use Perl for this task?
0
 

Author Comment

by:sagar24
ID: 8039520
hi
its easier to write the backup script in perl
as per my requirement so I am using perl

the whole scripts runs fine except for the find part
is there ne other alternate command
where I can find files ending with .txt
and simultaneous copy them to my backup directopry

Thanking you
regards
sagar Sirdesai
0
 

Accepted Solution

by:
dharmendra_rai earned 100 total points
ID: 8039830
You can use File::Find and File::Copy modules for that purpose
0
 
LVL 48

Assisted Solution

by:Tintin
Tintin earned 100 total points
ID: 8040246
Also look at the find2perl utility that comes with Perl.
0
 

Expert Comment

by:CleanupPing
ID: 9447451
sagar24:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Six Sigma Control Plans

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question