diff options
Diffstat (limited to 'intl/mangle-unprintable')
-rwxr-xr-x | intl/mangle-unprintable | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/intl/mangle-unprintable b/intl/mangle-unprintable new file mode 100755 index 0000000..7833c29 --- /dev/null +++ b/intl/mangle-unprintable @@ -0,0 +1,13 @@ +#!/bin/sh +i=128 +a="sed" +echo="`which echo`" +while [ $i -lt 256 ]; do + oct="`printf %03o $i`" + # dash's internal echo doesn't know -e + char="`"$echo" -e \\\\$oct`" + a="$a -e 's/$char/\\\\\\\\$oct/g'" + i=`expr $i + 1` +done +# bash and dash differ here: bash creates double backslashes, dash single +echo "$a"|sed 's/\\\\\\\\/\\\\/g' |