prrgrrmmng 

sed 's/`/`%60`/g;s/[\]/`%5C`/g;s/%[0-9A-F]\{2\}/`&`/g' | tr '`' '\n' | sed '/^%[0-9A-F]\{2\}$/!s/%/`%25`/' | tr '`' '\n' | awk '$0!~/%/{printf("%s",$0)}/%/{sub("%","0x");printf("\\%04o",$0)}' | xargs -0 printf '%b'

Follow

prrgrrmmng 

what she had:

› awk '$0!~/%/{printf("%s",$0)}/%/{sub("%","0x");printf("\\%04o",$0)}'

the portable awk script:

› awk '$0!~/%/{printf "%s",$0}/%/{sub("%","0x");cmd="xargs printf \"%04o\"";printf "%s","\\";printf "%s",$0|cmd;close(cmd)}'

· · Web · 1 · 0 · 0

re: prrgrrmmng 

for some reason gawk thinks that printf should not interpret its arguments the same as printf on the command line so instead you have to pipe to it if you need that bit

Sign in to participate in the conversation
📟🐱 GlitchCat

A small, community‐oriented Mastodon‐compatible Fediverse (GlitchSoc) instance managed as a joint venture between the cat and KIBI families.