--enable-developer

Arran Cudbard-Bell a.cudbardb at freeradius.org
Mon Nov 5 10:41:37 CET 2012


On 5 Nov 2012, at 09:17, Bjørn Mork <bjorn at mork.no> wrote:

> Arran Cudbard-Bell <a.cudbardb at freeradius.org> writes:
> 
>>>> 
>>>> Yes. Though it looks like ERX-Dhcp-Options is defined wrongly as a string in the vendor's dictionary, i'll go fix that...
>>> 
>>> Heh. So it works as is, with no additional hacks.
>> 
>> If anyone wants the octally escaped string to hex code I put it up here:
>> https://gist.github.com/4013951
> 
> Nice.  But you do know that C isn't exactly the best language for string
> manipulation? Alternative version:
> 
>  perl -e 'print "0x", unpack("H*",  eval "qq#".shift."#")'
> 
> OK, yours is readable :-)

Hmm not really equivalent because of the pre-escaping you'd need to do to get the string into perl unmolested. I challenge you to write a one liner that'll work with an arbitrary length string from STDIN :P

Also, I hate Perl, with a passion. Any time I write some I feel dirty, and it always comes out looking like someone vomited in the text editor.

-Arran


More information about the Freeradius-Devel mailing list