syntax question

Christopher Barry christopher.r.barry at gmail.com
Sat Sep 2 17:10:23 UTC 2017


Thanks Glen, I missed that man page.

-C


On Sep 2, 2017 12:48 AM, "Glenn Satchell" <glenn.satchell at uniq.com.au>
wrote:

> Hi Christopher
>
> Here's what it says in the dhcp-eval man page
>
> substring (data-expr, offset, length)
>
>        The substring operator evaluates the data  expression  and
>        returns  the  substring  of  the result of that evaluation
>        that starts offset bytes from  the  beginning,  continuing
>        for  length  bytes.   Offset  and  length are both numeric
>        expressions.  If data-expr, offset or length  evaluate  to
>        null,  then the result is also null.  If offset is greater
>        than or equal to the length of the evaluated data, then  a
>        zero-length data string is returned.  If length is greater
>        then the remaining length  of  the  evaluated  data  after
>        offset, then a data string containing all data from offset
>        to the end of the evaluated data is returned.
>
> So just make length be a number bigger than your string is ever likely to
> be, eg 1000, or 10,000, or 1,000,000 say.
>
> regards,
> -glenn
>
> On Sat, September 2, 2017 12:03 am, Christopher Barry wrote:
> >
> > Hello everyone,
> >
> > I want to use the substring keyword to return a part of a string that
> > starts at character 5, and goes to the end of the string. The strings
> > will be of variable length. Do I simply omit the second numeric
> > parameter to accomplish that? I can't find anything about this in the
> > man pages.
> >
> > Thanks
> >
> > --
> > Regards,
> > Christopher
> > _______________________________________________
> > dhcp-users mailing list
> > dhcp-users at lists.isc.org
> > https://lists.isc.org/mailman/listinfo/dhcp-users
> >
>
>
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20170902/57c92099/attachment.html>


More information about the dhcp-users mailing list