Hi all,
Does anyone know a bout a funtion which is similar to grep in Unix? I want to count the number of lines which match a pattern in a file and I intend to use "grep" command of Unix system:
$n=`grep -c -i "$line" filename`;
However if $line contains double quotation marks (i.e. " ) or single quotation mark (i.e. ' ) then the program doesn's work well. (However, there's no problem If I use directly this command in Unix)
Thank you very much,
Tiamose.
Does anyone know a bout a funtion which is similar to grep in Unix? I want to count the number of lines which match a pattern in a file and I intend to use "grep" command of Unix system:
$n=`grep -c -i "$line" filename`;
However if $line contains double quotation marks (i.e. " ) or single quotation mark (i.e. ' ) then the program doesn's work well. (However, there's no problem If I use directly this command in Unix)
Thank you very much,
Tiamose.