<HTML dir=ltr><HEAD><TITLE>Re: $generate lhs problem. Manual needs to be updated.</TITLE>
<META content="text/html; charset=unicode" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.7000.16"></HEAD>
<BODY>
<DIV dir=ltr id=idOWAReplyText14068>
<DIV dir=ltr><FONT color=#000000 size=2 face=Arial>Yes I guess I didn't understand it totally because in the example syntax is shown as lhs defined at the beginning</FONT></DIV>
<DIV dir=ltr> <SPAN><STRONG class=command>$GENERATE</STRONG></SPAN> <EM class=replaceable><CODE>range</CODE></EM> <EM class=replaceable><CODE>lhs</CODE></EM> [<SPAN class=optional><EM class=replaceable><CODE>ttl</CODE></EM></SPAN>] [<SPAN class=optional><EM class=replaceable><CODE>class</CODE></EM></SPAN>] <EM class=replaceable><CODE>type</CODE></EM> <EM class=replaceable><CODE>rhs</CODE></EM> [<SPAN class=optional> <EM class=replaceable><CODE>comment</CODE></EM> </SPAN>]</DIV>
<DIV dir=ltr>and when you read the explanation for lhs it shows the example <SPAN><STRONG class=command>${-20,3,d}.</STRONG></SPAN></DIV>
<DIV dir=ltr><SPAN>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</SPAN></DIV><SPAN><STRONG></STRONG></SPAN></DIV>
<DIV dir=ltr><PRE class=programlisting>$GENERATE 1-127 $ CNAME ${3,0,d}.0</PRE><PRE class=programlisting>taka</PRE>
<DIV dir=ltr><BR></DIV>
<DIV dir=ltr>
<HR tabIndex=-1>
</DIV>
<DIV dir=ltr><FONT size=2 face=Tahoma><B>From:</B> bind-users-bounces@lists.isc.org on behalf of Kevin Darcy<BR><B>Sent:</B> Wed 3/4/2009 8:20 PM<BR><B>To:</B> bind-users@lists.isc.org<BR><B>Subject:</B> Re: $generate lhs problem. Manual needs to be updated.<BR></FONT><BR></DIV></DIV>
<DIV>
<P><FONT size=2>Mark Andrews wrote:<BR>> In message <49AF42F8.9070103@chrysler.com>, Kevin Darcy writes:<BR>>  <BR>>> Jeremy,<BR>>> I don't think the definitions of "rhs" and "lhs" are at issue. What<BR>>> apparently led the original poster to the wrong solution initially was<BR>>> the verbiage in the manual stating "Any single *$* symbols within the<BR>>> *lhs* side are replaced by the iterator value", which implies that "$"<BR>>> replacement _only_ occurs within the LHS. As Mark confirmed, "$" can<BR>>> also occur in the RHS, and in fact that's what was required for the<BR>>> correct solution.<BR>>><BR>>> Personally, I wouldn't remove "within the LHS" from the verbiage<BR>>> completely, otherwise someone will undoubtedly complain about not being<BR>>> able to perform a "$" replacement in the class, type or TTL fields<BR>>> (users being users :-)<BR>>><BR>>> But, maybe it could be amended to "within the LHS or RHS"...<BR>>>    <BR>><BR>>       The quoted text was taken from a table describing all the<BR>>       elements of a $GENERATE.  I don't see how anyone reading<BR>>       the table could say that $ only is valid on the left hand<BR>>       side especially when there are examples above the table<BR>>       showing it on both sides.<BR>><BR>>       Mark<BR>><BR>> range<BR>>       This can be one of two forms: start-stop or start-stop/step.<BR>>       If the first form is used, then step is set to 1. All of<BR>>       start, stop and step must be positive.<BR>> lhs<BR>>       This describes the owner name of the resource records to be<BR>>       created.  Any single $ (dollar sign) symbols within the lhs<BR>>       side are replaced by the iterator value. To get a $ in the<BR>>       output, you need to escape the $ using a backslash \, e.g.<BR>>       \$. The $ may optionally be followed by modifiers which<BR>>       change the offset from the iterator, field width and base.<BR>>       Modifiers are introduced by a { (left brace) immediately<BR>>       following the $ as ${offset[,width[,base]]}. For example,<BR>>       ${-20,3,d} subtracts 20 from the current value, prints the<BR>>       result as a decimal in a zeropadded field of width 3.<BR>>       Available output forms are decimal (d), octal (o) and<BR>>       hexadecimal (x or X for uppercase). The default modifier<BR>>       is ${0,0,d}. If the lhs is not absolute, the current $ORIGIN<BR>>       is appended to the name.  For compatibility with earlier<BR>>       versions, $$ is still recognized as indicating a literal $<BR>>       in the output.<BR>> ttl<BR>>       Specifies the time-to-live of the generated records. If not<BR>>       specified this will be inherited using the normal ttl<BR>>       inheritance rules.  class and ttl can be entered in either<BR>>       order.<BR>> class<BR>>       Specifies the class of the generated records. This must<BR>>       match the zone class if it is specified.  class and ttl can<BR>>       be entered in either order.<BR>> type<BR>>       At present the only supported types are PTR, CNAME, DNAME,<BR>>       A, AAAA and NS.<BR>> rhs<BR>>       rhs is a domain name. It is processed similarly to lhs.<BR>><BR>> <BR>>  <BR>>> Jeremy C. Reed wrote:<BR>>>    <BR>>>> On Wed, 4 Mar 2009, Takahiro Masuda wrote:<BR>>>><BR>>>>  <BR>>>>      <BR>>>>> The tricky part is ${3,0,d} waas not working. I bumped into a site<BR>>>>> that stated $GENERATE range rhs type lhs<BR>>>>>    <BR>>>>>        <BR>>>> That is wrong.<BR>>>><BR>>>>  <BR>>>>      <BR>>>>> I then tried $GENERATE 11-30  $ PTR ${3,0,d}.COOL.COM. and this<BR>>>>> worked.<BR>>>>>    <BR>>>>>        <BR>>>>  <BR>>>>      <BR>>>>> Anybody here have the ability to update the manual?<BR>>>>>    <BR>>>>>        <BR>>>> Yes.<BR>>>><BR>>>> But it appears your second try is correct.<BR>>>><BR>>>> I can improve the documentation to make sure that it explains the two<BR>>>> abbreviations:<BR>>>><BR>>>> lhs is left hand side (the label).<BR>>>><BR>>>> rhs is the right hand side (the RDATA).<BR>>>><BR>>>> Will that work for you?<BR>>>>      <BR>You're right, I wasn't looking at the documentation in full context,<BR>only the text that the original poster showed.<BR><BR>Seems pretty clear to me, the example even shows "$" replacements on the<BR>right-hand side.<BR><BR>Perhaps the original poster will clarify what they think needs changing<BR>in the documentation.<BR><BR>Or, perhaps, were they trying to navigate the .html file without using a<BR>browser, e.g. in a text editor? That can give a pretty distorted view,<BR>but it's hardly ISC's fault if people do that...<BR><BR>                                                                        <BR>               - Kevin<BR><BR>_______________________________________________<BR>bind-users mailing list<BR>bind-users@lists.isc.org<BR><A href="https://lists.isc.org/mailman/listinfo/bind-users">https://lists.isc.org/mailman/listinfo/bind-users</A><BR></FONT></P></DIV></BODY></HTML>