StrLen of an Attribute
Nicolas Breuer
Nicolas.Breuer at belcenter.biz
Wed May 8 17:23:49 CEST 2019
Ok Alan so what is the correct syntax please ?
I saw in the doc
; %{#string}
: The number of characters in %{string}. If %{string} is not set, then the length is not set. This will NOT work for the one-character variables defined below.
: e.g. %{#Junk-junk:-foo} will yield the string "foo".
But ok this is not a string.
-----Message d'origine-----
De : Freeradius-Users <freeradius-users-bounces+nicolas.breuer=belcenter.biz at lists.freeradius.org> De la part de Alan DeKok
Envoyé : mercredi 8 mai 2019 17:19
À : FreeRadius users mailing list <freeradius-users at lists.freeradius.org>
Objet : Re: StrLen of an Attribute
> On May 8, 2019, at 10:59 AM, Nicolas Breuer <Nicolas.Breuer at belcenter.biz> wrote:
>
> Hello,
>
> Can you help how get the length of an attribute ?
>
> (%{#%{reply:Service-Type}} > 3)
>
> Returns "0"
Yes.
Because Service-Type isn't a string. It's an attribute of type "integer".
And why would you ever need to look at the string length of it?
And why would you use "(%{#%{reply:Service-Type}}" ? You're inventing syntax here. Nothing in the the documentation says that you can use:
${#
Much less
%{#%{reply:...
You can't just invent things and expect them to do what you want. Computers don't work that way.
Alan DeKok.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
More information about the Freeradius-Users
mailing list