Avatar of sagar24
sagar24
 asked on

Query regarding find command in perl

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
Programming

Avatar of undefined
Last Comment
CleanupPing

8/22/2022 - Mon
Tintin

Why do you want to use Perl for this task?
sagar24

ASKER
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
ASKER CERTIFIED SOLUTION
dharmendra_rai

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Tintin

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
CleanupPing

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.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes