Which hack is this? (golf challenge?)
Hal Duston
hald at sound.net
Tue Dec 10 00:35:18 CST 2002
David Nicol wrote:
> [david at chicago david]$ perl -ple 's/%(..)/chr(hex($1))/ge'
> '%77ww.o%6e%6cine%2du%70d%61%74e-c%65%6e%74%65%72%2ec%6fm'
> 'www.online-update-center.com'
> [david at chicago david]$
How about a bash one-liner?
$ bash -c 'printf "`echo ${1} | sed s/%/\\\x/g`n"' bash
'%77ww.o%6e%6cine%2du%70d%61%74e-c%65%6e%74%65%72%2ec%6fm'
www.online-update-center.com
$
Hal Duston
More information about the Kclug
mailing list