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

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

by jwkrahn (Monsignor)
on May 18, 2009 at 01:51 UTC ( #764569=note: print w/ replies, xml ) Need Help??


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

Or:

perl -e'system zip => -d => /\t(.*)/, "*exe*" for `du -b */*/old.zip`'


Comment on Re^3: multiple file operations using perl one-liners
Download Code
Re^4: multiple file operations using perl one-liners
by ikegami (Pope) on May 18, 2009 at 03:20 UTC

    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

      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://764569]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2014-04-21 00:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (489 votes), past polls