query in searching

2009-03-24 Thread Rajini Naidu
Hi, I am trying to search for a pattern in a file in my perl script. Syntax used is : system("grep \"$res\" ${data_dir}/${node}.load > /tmp/${day[0]}.${day[1]}.${day[2]}.${node}.log"); But the grep command is'nt successful in getting the desired string. Am I missing anything here ? Rajini

Re: query in searching

2009-03-24 Thread John W. Krahn
Rajini Naidu wrote: Hi, Hello, I am trying to search for a pattern in a file in my perl script. Syntax used is : system("grep \"$res\" ${data_dir}/${node}.load > /tmp/${day[0]}.${day[1]}.${day[2]}.${node}.log"); But the grep command is'nt successful in getting the desired string. Am I miss

Re: query in searching

2009-03-24 Thread Rajini Naidu
Thanks John for the reply. I included the code as you suggested, but does'nt seem to work. The output file is empty. -rajini On Wed, Mar 25, 2009 at 12:19 AM, John W. Krahn wrote: > Rajini Naidu wrote: > >> Hi, >> > > Hello, > > > I am trying to search for a pattern in a file in my pe

Re: query in searching

2009-03-24 Thread Chas. Owens
On Tue, Mar 24, 2009 at 19:50, Rajini Naidu wrote: snip >> open my $IN,  '<', "$data_dir/$node.load" or die "Cannot open >> '$data_dir/$node.load' $!"; >> open my $OUT, '>', "/tmp/$day[0].$day[1].$day[2].$node.log" or die "Cannot >> open '/tmp/$day[0].$day[1].$day[2].$node.log' $!"; >> >> while (