Variable: tramp-awk-encode
tramp-awk-encode is a variable defined in tramp-sh.el.gz.
Value
"%a '\\\nBEGIN {\n b64 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"\n b16 = \"0123456789abcdef\"\n}\n{\n for (c=1; c<=length($0); c++) {\n d=index(b16, substr($0,c,1))\n if (d--) {\n for (b=1; b<=4; b++) {\n o=o*2+int(d/8); d=(d*2)%%16\n if (++obc==6) {\n printf substr(b64,o+1,1)\n if (++rc>75) { printf \"\\n\"; rc=0 }\n obc=0; o=0\n }\n }\n }\n }\n}\nEND {\n if (obc) {\n tail=(obc==2) ? \"==\\n\" : \"=\\n\"\n while (obc++<6) { o=o*2 }\n printf \"%%c\", substr(b64,o+1,1)\n } else {\n tail=\"\\n\"\n }\n printf tail\n}'"
Documentation
awk program to use for encoding a file.
Format specifiers are replaced by tramp-expand-script, percent
characters need to be doubled.
Source Code
;; Defined in /usr/src/emacs/lisp/net/tramp-sh.el.gz
(defconst tramp-awk-encode "\
%a '\\
BEGIN {
b64 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"
b16 = \"0123456789abcdef\"
}
{
for (c=1; c<=length($0); c++) {
d=index(b16, substr($0,c,1))
if (d--) {
for (b=1; b<=4; b++) {
o=o*2+int(d/8); d=(d*2)%%16
if (++obc==6) {
printf substr(b64,o+1,1)
if (++rc>75) { printf \"\\n\"; rc=0 }
obc=0; o=0
}
}
}
}
}
END {
if (obc) {
tail=(obc==2) ? \"==\\n\" : \"=\\n\"
while (obc++<6) { o=o*2 }
printf \"%%c\", substr(b64,o+1,1)
} else {
tail=\"\\n\"
}
printf tail
}'"
"`awk' program to use for encoding a file.
Format specifiers are replaced by `tramp-expand-script', percent
characters need to be doubled.")