$generate lhs problem. Manual needs to be updated.

Takahiro Masuda tmasuda at vpls.net
Thu Mar 5 07:48:43 UTC 2009


Yes I guess I didn't understand it totally because in the example syntax is shown as lhs defined at the beginning
 $GENERATE range lhs [ttl] [class] type rhs [ comment ]
and when you read the explanation for lhs it shows the example ${-20,3,d}.
So I thought that ${-20,3,d} should be defined on the left side.  The example only shows one part. I think it'll be helpful if you add the whole line in the example so users can see where to place it in the syntax
$GENERATE 1-127 $ CNAME ${3,0,d}.0
taka

________________________________

From: bind-users-bounces at lists.isc.org on behalf of Kevin Darcy
Sent: Wed 3/4/2009 8:20 PM
To: bind-users at lists.isc.org
Subject: Re: $generate lhs problem. Manual needs to be updated.



Mark Andrews wrote:
> In message <49AF42F8.9070103 at chrysler.com>, Kevin Darcy writes:
>  
>> Jeremy,
>> I don't think the definitions of "rhs" and "lhs" are at issue. What
>> apparently led the original poster to the wrong solution initially was
>> the verbiage in the manual stating "Any single *$* symbols within the
>> *lhs* side are replaced by the iterator value", which implies that "$"
>> replacement _only_ occurs within the LHS. As Mark confirmed, "$" can
>> also occur in the RHS, and in fact that's what was required for the
>> correct solution.
>>
>> Personally, I wouldn't remove "within the LHS" from the verbiage
>> completely, otherwise someone will undoubtedly complain about not being
>> able to perform a "$" replacement in the class, type or TTL fields
>> (users being users :-)
>>
>> But, maybe it could be amended to "within the LHS or RHS"...
>>    
>
>       The quoted text was taken from a table describing all the
>       elements of a $GENERATE.  I don't see how anyone reading
>       the table could say that $ only is valid on the left hand
>       side especially when there are examples above the table
>       showing it on both sides.
>
>       Mark
>
> range
>       This can be one of two forms: start-stop or start-stop/step.
>       If the first form is used, then step is set to 1. All of
>       start, stop and step must be positive.
> lhs
>       This describes the owner name of the resource records to be
>       created.  Any single $ (dollar sign) symbols within the lhs
>       side are replaced by the iterator value. To get a $ in the
>       output, you need to escape the $ using a backslash \, e.g.
>       \$. The $ may optionally be followed by modifiers which
>       change the offset from the iterator, field width and base.
>       Modifiers are introduced by a { (left brace) immediately
>       following the $ as ${offset[,width[,base]]}. For example,
>       ${-20,3,d} subtracts 20 from the current value, prints the
>       result as a decimal in a zeropadded field of width 3.
>       Available output forms are decimal (d), octal (o) and
>       hexadecimal (x or X for uppercase). The default modifier
>       is ${0,0,d}. If the lhs is not absolute, the current $ORIGIN
>       is appended to the name.  For compatibility with earlier
>       versions, $$ is still recognized as indicating a literal $
>       in the output.
> ttl
>       Specifies the time-to-live of the generated records. If not
>       specified this will be inherited using the normal ttl
>       inheritance rules.  class and ttl can be entered in either
>       order.
> class
>       Specifies the class of the generated records. This must
>       match the zone class if it is specified.  class and ttl can
>       be entered in either order.
> type
>       At present the only supported types are PTR, CNAME, DNAME,
>       A, AAAA and NS.
> rhs
>       rhs is a domain name. It is processed similarly to lhs.
>
> 
>  
>> Jeremy C. Reed wrote:
>>    
>>> On Wed, 4 Mar 2009, Takahiro Masuda wrote:
>>>
>>>  
>>>      
>>>> The tricky part is ${3,0,d} waas not working. I bumped into a site
>>>> that stated $GENERATE range rhs type lhs
>>>>    
>>>>        
>>> That is wrong.
>>>
>>>  
>>>      
>>>> I then tried $GENERATE 11-30  $ PTR ${3,0,d}.COOL.COM. and this
>>>> worked.
>>>>    
>>>>        
>>>  
>>>      
>>>> Anybody here have the ability to update the manual?
>>>>    
>>>>        
>>> Yes.
>>>
>>> But it appears your second try is correct.
>>>
>>> I can improve the documentation to make sure that it explains the two
>>> abbreviations:
>>>
>>> lhs is left hand side (the label).
>>>
>>> rhs is the right hand side (the RDATA).
>>>
>>> Will that work for you?
>>>      
You're right, I wasn't looking at the documentation in full context,
only the text that the original poster showed.

Seems pretty clear to me, the example even shows "$" replacements on the
right-hand side.

Perhaps the original poster will clarify what they think needs changing
in the documentation.

Or, perhaps, were they trying to navigate the .html file without using a
browser, e.g. in a text editor? That can give a pretty distorted view,
but it's hardly ISC's fault if people do that...

                                                                        
               - Kevin

_______________________________________________
bind-users mailing list
bind-users at lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/bind-users/attachments/20090304/a9f68694/attachment.html>


More information about the bind-users mailing list