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

Perl Commands for Unix/Linux

by sanPerl (Friar)
on Jan 24, 2013 at 10:16 UTC ( [id://1015137]=perlquestion: print w/replies, xml ) Need Help??

sanPerl has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

Greetings,

I am trying to find out equivalent Perl code/command for
cp - al DIRX DIRY
I would be grateful if I can get any clues please.

Replies are listed 'Best First'.
Re: Perl Commands for Unix/Linux
by rovf (Priest) on Jan 24, 2013 at 10:31 UTC
    Well, I guess you meant
    cp -al
    and not
    cp - al
    - right?

    Though the usual suggestion for a Perl replacement of /bin/cp, would be to use to File::Copy, this doesn't apply in your case, since you want to create hard links. Is there a particular reason why you don't just shell out, i.e. system('cp -al DIRX DIRY')?

    -- 
    Ronald Fischer <ynnor@mm.st>
      Dear Ronald
      using system or exec is the default option. However if any Perl module can link and Archive the file while copying, then I will prefer it. It seems that I have to use the default option in this case. Thanks to you for your help.
Re: Perl Commands for Unix/Linux
by toolic (Bishop) on Jan 24, 2013 at 13:14 UTC
      Where is the -l option?

        -l : create a link instead to copy files

        the perl function here should be probably "link" instead copy (or "symlink" if you want instead a soft link). I had not verified that works with directories, so try first with something that you can lose.

        link DIRX DIRY

Re: Perl Commands for Unix/Linux
by Anonymous Monk on Jan 24, 2013 at 10:42 UTC
Re: Perl Commands for Unix/Linux
by Anonymous Monk on Jan 24, 2013 at 10:26 UTC
    What does that code do?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2024-04-19 18:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found