grep -f problem
Dave Korn
dave.korn@artimi.com
Mon Jul 16 14:38:00 GMT 2007
On 16 July 2007 15:12, Mårten Gustafsson wrote:
> Hi
>
> I have a problem with grep -f. Here is my example script:
>
> #!sh
> echo -e "calvin\nhobbes" > expressions.txt
> echo -e "calvin chases\nhis favourite imaginary friend\nhobbes" > text.txt
> grep -f expressions.txt text.txt
>
> The output is:
> $ grepbug.sh
> hobbes
>
> The expected output:
>
> C:\UnxUtils\usr\local\wbin>sh grepbug.sh
> calvin chases
> hobbes
>
> I am not very familiar with unix or cygwin. Is there a kind soul to verify
> that this is really a problem by running the scrip on a true unix?
I can do better: I can verify it's Not A Bug by running the script on cygwin
and seeing that it works fine. On the other hand, if I get the script to run
"unix2dos" on 'expressions.txt' and 'text.txt' before grepping them, I get the
result you were expecting.
Are you on a textmode mount or something? Or do you perhaps have some dos
line-endings in the grepbug script file itself?
cheers,
DaveK
--
Can't think of a witty .sigline today....
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
More information about the Cygwin
mailing list