The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 09-20-2007
emjayshaikh emjayshaikh is offline
Registered User
 

Join Date: Sep 2007
Posts: 2
i used perl to solve the problem i had. thanks.

#!/usr/bin/perl
$n = `egrep -n "string" filename | egrep -o "[[:digit:]]{1,}" | sed q`;
$m = `egrep -n "string" filename | egrep -o "[[:digit:]]{1,}" | sed q`;
$c= $m - $n;
print $c
Reply With Quote