grep issue of escaping backticks in perl
Hi all,
i have a file where "lines have uh, or huh or uh-huh" in them i want the line numbers with only "uh" in them now the issue is: in perl, @abc = `grep -n uh $file`; gives the result with all uh, huh, uh-huh i tried reg-ex but it is not working properly, especially single quotes are giving some issues... pls help regards, rajat |
If 'uh' is the only thing on the line then try something like this. (I try to avoid using grep or any other 'system' command if Perl has an internal way of doing it.)
Code:
#!/usr/bin/perl -w |
Not using perl here, but try:
Code:
`egrep -n 'uh[ $]+'` Cheers, Tink |
All times are GMT -5. The time now is 10:48 PM. |