#!/bin/sh # Underlines non-printable characters in the input stream. # Underlining is done by means of a line which is a sequence # of spaces and '^'-characters. # # terminfo(5) is used to additionally highlight the underlined places. STANDOUT="$(tput smso)" offSTANDOUT="$(tput rmso)" BOLD="$(tput bold)" offBOLD="$(tput sgr0)" #UNDERLINE="$(tput smul)" #offUNDERLINE="$(tput rmul)" sed -e "/[^[:print:]]/{ h; s/[^[:print:]]/$STANDOUT&$offSTANDOUT/g; p; g; s/[[:print:]]/ /g; s/[^[:print:]]/$BOLD^$offBOLD/g; }"