Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

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


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

Replies are listed 'Best First'.
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' */*/

      TMTOWTDI    ;-)

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://764569]
[erix]: do you mean: 'it can be done simpler', or 'it won't work' ?
[choroba]: I wouldn't want to maintain it in the current form
[erix]: ok, but mainainability comes after it has been made to work :)
[erix]: maybe I should have cobbled together a more simple example
[erix]: the main question is whether repeating groups get captured. I thought they did but it looks they do not.

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2018-01-19 08:36 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (216 votes). Check out past polls.