Phil M Perry wrote:
> Thanks Mark, but it didn't seem to work. grep "\xEF" seems to match a
> literal \xEF string, not a byte with that value. I also tried octal without
> success, and single quotes instead double. Any other ideas?
If you're in a unicode terminal, you may be able to just paste in the unicode
chars:
$ grep 'úø' unicode.txt
test chars: úø
Of course, this assumes the encoding of the terminal matches that of the files
that you're searching.
Echo should be a bit more predictable:
$ grep "$(echo -e '\xc3\xba\xc3\xb8')" unicode.txt
test chars: úø
You could also use perl or python or ruby:
$ python <<__eof__
import re
src = open('unicode.txt')
rx = re.compile(r'\xc3\xba\xc3\xb8')
for line in src:
if rx.search(line):
print line
__eof__
Lots more code, but possibly more useful if you are doing other processing.
>
> Mark Donoghue wrote:
> > I found this:
> >
> > http://tracker.moodle.org/browse/MDL-10637
> >
> > by searching the Google for "grep search BOM"
> >
> > Good luck,
> > Mark
>
> _______________________________________________
> Mid-Hudson Valley Linux Users Group http://mhvlug.org
> http://mhvlug.org/cgi-bin/mailman/listinfo/mhvlug
> Upcoming Meetings (6pm - 8pm) MHVLS Auditorium
> Mar 7 - Web Hack-a-thon - SUNY Newpaltz
> Apr 1 - EC2 and Cloud Computer
> May 6 - TBD
>
=============================================================================
michaelMuller = [email protected] | http://www.mindhog.net/~mmuller
-----------------------------------------------------------------------------
Society in every state is a blessing, but government even in its best state
is but a necessary evil; in its worst state an intolerable one...
- Thomas Paine
=============================================================================
_______________________________________________
Mid-Hudson Valley Linux Users Group http://mhvlug.org
http://mhvlug.org/cgi-bin/mailman/listinfo/mhvlug
Upcoming Meetings (6pm - 8pm) MHVLS Auditorium
Mar 7 - Web Hack-a-thon - SUNY Newpaltz
Apr 1 - EC2 and Cloud Computer
May 6 - TBD