update tools/textviewer.sh (sync with HEAD)