Issues with termcap and Benchmarking Tools

In order to run some benchmarking tools, termcap and related environment variables are required. These variables are generally available and no problem, but sometimes (in some configurations involving ZSH), these environment variables contain characters that are invalid in XML files. As some benchmarking tools generate XML reports without first cleaning the inputs, this can be troubling and become quite a nuisance. To work against this, offending termcap entries can be stripped of the current environment by running the following short shell one-liner:

source <(env | awk -F "=" '/LESS_TERMCAP/{ print "unset " $1 }')

This is generally enough to avoid the issues explained above.

I hope this entry in the series of (small but) interesting shell snippets becomes helpful!