neversaint has asked for the wisdom of the Perl Monks concerning the following question:
Dear Masters,
I have the following subdirectories:
I have the following subdirectories:
What I am trying to do is to traverse "dir*" and execute "gunzip" command on the files inside them. I tried this code, but doesn't work:-dir1 |_ file1.gz |_ ... |_ file1000.gz ... -dir100 |_file1.gz |_ ... |_ file300.gz
Please advice what's wrong with the above construct?for my $sd (@dirs) { system("cd $sd"); system("gunzip *.gz"); }
---
neversaint and everlastingly indebted.......
neversaint and everlastingly indebted.......
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Traversing SubDir and Execute Unix Command
by Corion (Patriarch) on Nov 08, 2008 at 16:08 UTC | |
Re: Traversing SubDir and Execute Unix Command
by ig (Vicar) on Nov 08, 2008 at 17:59 UTC | |
Re: Traversing SubDir and Execute Unix Command
by Perlbotics (Archbishop) on Nov 08, 2008 at 17:17 UTC | |
Re: Traversing SubDir and Execute Unix Command
by Cody Pendant (Prior) on Nov 08, 2008 at 22:50 UTC | |
Re: Traversing SubDir and Execute Unix Command
by crusher (Acolyte) on Nov 08, 2008 at 19:16 UTC | |
Re: Traversing SubDir and Execute Unix Command
by mhearse (Chaplain) on Nov 08, 2008 at 21:42 UTC | |
Re: Traversing SubDir and Execute Unix Command
by Anonymous Monk on Nov 09, 2008 at 12:57 UTC |
Back to
Seekers of Perl Wisdom