Query regarding find command in perl

Posted on 2003-02-27
Medium Priority
Last Modified: 2011-09-20
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


Sagar Sirdesai
Question by:sagar24
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 48

Expert Comment

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

Author Comment

ID: 8039520
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
sagar Sirdesai

Accepted Solution

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

Assisted Solution

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

Expert Comment

ID: 9447451
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 
Post your closing recommendations!  No comment means you don't care.

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Suggested Courses

770 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