Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Traversing SubDir and Execute Unix Command

by Perlbotics (Bishop)
on Nov 08, 2008 at 17:17 UTC ( #722418=note: print w/replies, xml ) Need Help??


in reply to Traversing SubDir and Execute Unix Command

Is this limited to *NIX? FWIW, you can merge your system calls into one:

for my $sd (@dirs) { system(qq{cd "$sd" && gunzip *.gz}); }
Personally, I would add a check for system's return value and redirect gunzips output. For more robustness it might be better (slightly slower) to first scan for all *.gz files below @dirs and then decompress each file individually. That would allow to check the success of the decompression operation for each individual file - if that matters.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2020-04-08 16:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The most amusing oxymoron is:
















    Results (45 votes). Check out past polls.

    Notices?