Bheem
-Original Message-
From: Arnold, Craig [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 1:07 PM
To: AITHA, BHEEMSEN (SBCSI); '[EMAIL PROTECTED]'
Subject: RE: [Perl-unix-users] Please help on GREP command
You appear to be trying to use the command-line version of grep, rat
-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 1:10 PM
To: AITHA, BHEEMSEN (SBCSI)
Cc: [EMAIL PROTECTED]
Subject: RE: [Perl-unix-users] Please help on GREP command
Sorry All...
The 'die' command should have read:
die "ERROR: Problem exec
3:08 PM
To: 'ba2984'
Cc: 'perl-unix-users'
Subject: RE: [Perl-unix-users] Please help on GREP command
The back-tics will automatically execute the grep command.
So,
$var=`grep -E -i -c "abc|xyz|pqr" test.txt`;
will execute the grep command just like from the sh
You appear to be trying to use the command-line version of grep, rather than
a Perl grep. To get what you appear to be looking for in Perl would require
opening the file:
Script: grep.pl
#!perl -w
use strict ;
my $fn = "test.txt" ;
open(INFILE, $fn) or die "Can'
EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 2:52 PM
To: david.b.deline
Cc: perl-unix-users
Subject: RE: [Perl-unix-users] Please help on GREP command
Then how do I execute the command in $var ? I want to check the return
code
of that grep command. Please help me. I am new to PERL.
Thanx..
-Bheem
-
)
Cc: [EMAIL PROTECTED]
Subject: RE: [Perl-unix-users] Please help on GREP command
Is that the exact line...?
Try:
$var=`grep -E -i -c "abc|xyz|pqr" test.txt`;
Remember to put your shell commands in back-tics...
Dave.
-Original Message-
From: ba2984 [mailto:[EMAIL PROTECTED]]
Se
Is that the exact line...?
Try:
$var=`grep -E -i -c "abc|xyz|pqr" test.txt`;
Remember to put your shell commands in back-tics...
Dave.
-Original Message-
From: ba2984 [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 1:23 PM
To: perl-unix-users
Subject: [Perl-unix-users] Please