CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Copy Command Error in my Program

 



ccelt09
New User

Aug 1, 2013, 2:39 AM

Post #1 of 5 (465 views)
Copy Command Error in my Program Can't Post

Hi all,

I have 6 Perl programs that involve an initial file copy command. For 4 of the 6 it works perfectly fine but 2 of the 6 stop running in my terminal window and print:

usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file
cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory
.chr.23.txtmask.NA12004

where the bottom line appears to be a distortion of the initial filename, it should be mask.NA12004.chr.23.txt

When I preform the same isolated cp commands outside of the perl script, with terminal, it works, leaving me quite confused.

Can anyone explain what this message is communicating about the program?


FishMonger
Veteran / Moderator

Aug 1, 2013, 6:14 AM

Post #2 of 5 (453 views)
Re: [ccelt09] Copy Command Error in my Program [In reply to] Can't Post

If a usage statement "error message" is being displayed, that typically means that script didn't receive the proper arguments.

You'll need to provide the script and how you're calling it for us to help you fix it.


(This post was edited by FishMonger on Aug 1, 2013, 6:14 AM)


BillKSmith
Veteran

Aug 1, 2013, 6:51 AM

Post #3 of 5 (448 views)
Re: [FishMonger] Copy Command Error in my Program [In reply to] Can't Post

I think it is more likely that the error message comes from an external program (or UNIX ? command) called "cp". The "bottom line" may not even be part of the same message.

Of course, this does not change your advice. We must see the offending scripts and how they are called. We probably also need to know the operating system.
Good Luck,
Bill


FishMonger
Veteran / Moderator

Aug 1, 2013, 6:58 AM

Post #4 of 5 (447 views)
Re: [BillKSmith] Copy Command Error in my Program [In reply to] Can't Post

The OP cross posted this on perlmonks
http://www.perlmonks.org/?node_id=1047413


Laurent_R
Veteran / Moderator

Aug 1, 2013, 2:45 PM

Post #5 of 5 (442 views)
Re: [BillKSmith] Copy Command Error in my Program [In reply to] Can't Post


In Reply To
We probably also need to know the operating system.


Given the nature of the error message, the OS is almost undoubtedly some U*ix variant. It would still be good to know which variant, and also to know which type of shell is being used.

But, as pointed out by FishMonger and Bill, the main point is still to see the Perl script, or the part of the script where the error is happening, to be able to see the exact command being issued.

Nobody can say more on this problem at this point without such details.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives