#!/bin/bash LANG=C p=printf\ -v B=({A..Z} {a..z} {0..9} + /);$p A \\%o {32..126};$p A $A $p C %-20sE abtnvfr;while IFS= read -r -d '' -n 1 c;do if [ "$c" ];then $p \ c %q "$c";case ${#c} in 1|2)c=${A%$c*};P+=($[${#c}+32]);;7)c=${c#*\'\\};P+=( $[8#${c%\'}]);;5)c=${c#*\'\\};c=${C%${c%\'}*};P+=($[${#c}+7]) ;;*)echo>&2 E\ :$c;;esac;else P+=(0);fi;if((${#P[@]}>2));then c=$[P<<16|${P[1]}<<8|${P[2]}] l+=${B[c>>18]}${B[c>>12&63]}${B[c>>6&63]}${B[c&63]};((${#l}>72 ))&&echo $l&& l=;P=();fi;done;[ "$P" ]&&{ f=0;while((${#P[@]}<3));do P+=(0);((f+=1));done; c=$[P<<16|${P[1]}<<8|${P[2]}]; l+=${B[c>>18]}${B[c>>12&63]}${B[c>>6&63]}${B[ c&63]};l=${l::${#l}-f};$p f %$f\s;};echo $l${f// /=}