Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Cannot copy files from linux shared to windows

by Discipulus (Canon)
on Nov 05, 2014 at 09:00 UTC ( [id://1106166]=note: print w/replies, xml ) Need Help??


in reply to [Solved] Cannot copy files from linux shared to windows

...the script doesn't work.
is not very descriptive: it dies at some of your dies? what error Perl reports?
Reading your code as I understand it you tell Perl something like:
"Perl please for every file in the glob expression if it is a plain file, open it, read it and FOR EVERY occurence of a specified word copy this file to destination with File::Copy AND with the system call". you can use last after the first copy was succesfull.

More notably you are calling the system call inside single quotes ('') and not backticks (``) that you can type with ALT+96 combo.
Pay attention also to the directory separator on windows (you can safely use / instead of \ ): see Glob portabilty issues

HtH
L*
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re^2: Cannot copy files from linux shared to windows
by bbb (Novice) on Nov 06, 2014 at 00:29 UTC

    Thank you for pointing out on how I can improve my scripting.

    I had updated the code removing the "cp -r " line for it really should not be included in my query.

    I'll modify the script and will let you know the result.

    Thanks again!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1106166]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-25 09:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found