#!/bin/bash
#: grep files for non-ASCII bytes/characters.  If you want, you can specify:  -r to recurse
#==============================================================================#
# sburke@cpan.org    ( Last Modified Time-stamp: "2016-06-22 16:18:29 MDT" )

 
( LC_ALL=C   grep --line-number --perl-regexp --regexp='[^\x00-\x7f]'   "$@"  ) | cat


#======================================================================
#
# Notes about the code:
#   End users can stop reading here.
#   Having LC_ALL setting seems to mean we work only byte-wise... notably, we won't
#    try to read the input stream as UTF8 and reject, on read!, anything that's
#    not a valid UTF8 sequence.
#    But then somehow that "cat", outside the locale change, does... a magic thing.
#   I think I can change "grep" to "exec grep", but if it ain't broke don't fix it.
#   Ditto using dash instead of bash... but, again, if it ain't broke don't fix it.

