Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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

by jwkrahn (Abbot)
on May 18, 2009 at 01:51 UTC ( [id://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`'

Replies are listed 'Best First'.
Re^4: multiple file operations using perl one-liners
by ikegami (Patriarch) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://764569]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2024-03-28 14:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found