Re: help with awk command in perl
- From: krahnj@xxxxxxxxx (John W. Krahn)
- Date: Tue, 29 Aug 2006 09:49:44 -0700
Sayed, Irfan (Irfan) wrote:
Hi All,
Hello,
I have a following script in perl in which i am using awk command but it
is not getting executed properly.
# /usr/atria/bin/Perl -w
use strict;
use warnings;
my $fname = "/tmp/checkvob_log";
open(FILE,">>$fname");
my $CT = "/usr/atria/bin/cleartool";
my @vob_list = `$CT lsvob -s`;
my @vob_list1 = `$CT lsvob`;
print FILE @vob_list1;
my $cmd1 = "awk '{print $3}' /tmp/checkvob_log";
my @vob_path = qx{$cmd1};
print @vob_list;
print @vob_path;
Why not just do that in perl:
#!/usr/atria/bin/Perl
use strict;
use warnings;
my $fname = '/tmp/checkvob_log';
open FILE, '>>', $fname or die "Cannot open '$fname' $!";
my $CT = '/usr/atria/bin/cleartool';
my @vob_list = `$CT lsvob -s`;
my @vob_list1 = `$CT lsvob`;
print FILE @vob_list1;
open FILE, '<', $fname or die "Cannot open '$fname' $!";
my @vob_path = map { ( split )[ 2 ] } @vob_list1;
print @vob_list;
print @vob_path;
John
--
use Perl;
program
fulfillment
.
- Follow-Ups:
- Re: help with awk command in perl
- From: John W. Krahn
- Re: help with awk command in perl
- References:
- help with awk command in perl
- From: Irfan Sayed
- help with awk command in perl
- Prev by Date: Time::Local let me faint
- Next by Date: Re: Time::Local let me faint
- Previous by thread: Re: help with awk command in perl
- Next by thread: Re: help with awk command in perl
- Index(es):
Relevant Pages
|
|