| From: "Philip Reynolds" <philip.reynolds at gmail.com>
| Date: Tue, 14 Aug 2007 14:44:25 +0100
| On 14/08/07, Brian Foster <blf at utvinternet.ie> wrote:
| > weird character someplace? [ ... ]
| set invlist in vim is handy for these things, as well as using od(1)
| with `od -c' to weed out strange characters in files.
I cannot find any doc on ‘:set invlist’, albeit
it seems to be identical to the extremely useful
‘:set list’ (which I use all the time!).
pedantically, ‘od -c’ is good for finding weird
bytes (esp. in US-ASCII encoded files, as should
be the case for the OP's /etc/crontab). for 8-bit
encodings, and multi-bytes encodings (e.g. UTF-8),
‘od -c’ can be more confusing than useful.
similar to ‘od -c˚ is ‘hexdump -C’ which is often
a bit easier to decipher. still works best with
7-bit encodings, however ....
qed(1) had a very useful RE expression, ‘\_’ as
I recall, which matched any single non-printable
character. there's probably some ERE class (or
inversion thereof) which is similar, but I don't
know it off-hand. ‘[^[:print:]]’ maybe? a very
trivial test suggests that considers HTAB to match,
which is annoying but easily fixed: ‘[^[:print:]_]’
(where ‘_’ is a literal tab).†
† if yer using the GNU bash(1) shell, you can
use the (rare) $'...' notation to write:
grep -e $'[^[:print:]\t]' ...
▶ ▶ I AM CURRENTLY LOOKING FOR A JOB! ◀ ◀ | Brian Foster
Experienced (>25 yrs) software engineer: | Montpellier, FRANCE
• Unix, Linux, embedded, design-for-test; | Stop E$$o (ExxonMobile)!
• Software/hardware co-design, debugging; | http:/www.stopesso.com
• Kernels, drivers, filesystems, &tc; Résumé (CV) & contact details:
• IDL, automated testing, process, &tc. http://www.blf.utvinternet.ie
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!