in reply to Re: How to Execute unix commands like "WC, tail, Gunzip, ZIP" against a file which is read from directory
in thread How to Execute unix commands like "WC, tail, Gunzip, ZIP" against a file which is read from directory
Thanks for your valuable suggestion.
i have used the below code and it works for me
can we store the value of unix command in some variable because when we execute the unix command it will either return 0 or 1, i want to store the value
chdir($dir); foreach my $file (@files) { if ($file=~ m/orig/) { my $lcmd = system("gunzip -c $file|tail -1"); }
Output:
123456|345627899292|000108418|
i want to store the value 123456|345627899292|000108418| in variable so that i can use substr to fetch '000108418'
Thanks a lot for the valuable inputs
thanks & regards,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: 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 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 |