Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^4: multiple file operations using perl one-liners

by ikegami (Pope)
on May 18, 2009 at 03:20 UTC ( #764574=note: print w/ replies, xml ) Need Help??


in reply to Re^3: multiple file operations using perl one-liners
in thread multiple file operations using perl one-liners

Is there any advantage to this variant? It's longer and buggy (missing chomp). It's also less clear due the weird use of => to separate two of three arguments, especially when it's also used to associate the arguments to the command.

Either way, I just realised du is useless.

perl -e'system zip => "-d", $_, "*exe*" for @ARGV' */*/old.zip


Comment on Re^4: multiple file operations using perl one-liners
Select or Download Code
Re^5: multiple file operations using perl one-liners
by jwkrahn (Monsignor) on May 18, 2009 at 06:00 UTC

    TMTOWTDI    ;-)

    perl -e'system "zip", "-d", $_, "*exe*" for <*/*/old.zip>'
      That fails for paths with spaces. That may not be a problem for the OP, but it would be for me.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (20)
As of 2015-07-07 14:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (88 votes), past polls