in reply to How to Execute unix commands like "WC, tail, Gunzip, ZIP" against a file which is read from directory
Alternatively, instead of
you could dosystem("wc -l $file");
which is less efficient, but if instead of wc you have another command, which works in the current directory, this might even be better.system("cd $dir; wc -l $file");
Of course, most efficient is chdir before you loop over the files (as suggested by smls)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to Execute unix commands like "WC, tail, Gunzip, ZIP" against a file which is read from directory
by rajsai28 (Novice) on Jun 07, 2013 at 03:10 UTC | |
by rajsai28 (Novice) on Jun 07, 2013 at 06:16 UTC | |
by Corion (Patriarch) on Jun 07, 2013 at 06:21 UTC | |
by rajsai28 (Novice) on Jun 07, 2013 at 10:02 UTC |