cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
341
Views
0
Helpful
3
Replies
Beginner

Using parameterized template values for a partial command value

In CiscoWorks I am trying to do something like the following with a user task and parameter file:

     username Store$StoreNum password 0 $VPNPwdPfx_B34567

where $StoreNum and $VPNPwdPfx are parameter values from a template file. The relevant parts of the template file are :

<CMDPARAM NAME = StoreNum>
<value>100</value>
</CMDPARAM>
<CMDPARAM NAME = VPNPwdPfx>
<value>1_00</value>
</CMDPARAM>

The first parameter of the command the(StoreNum) works fine and produces something like the following Store100, but the 2nd fails as I thinks the whole value after the $ is the parameter name when . Is there a way to tell CW that there is an additional string after the parameter name (_B34567) so that it would produce the following:

     username Store100 password 0 1_00_B34567    

Thanks

Don

Everyone's tags (2)
3 REPLIES 3
Highlighted
Hall of Fame Cisco Employee

Re: Using parameterized template values for a partial command va

Unfortunately, the way the matcher code works, you cannot use such a pattern.  The workaround, of course, will be to have the variable specify the full pattern.  You can use the per-device capability of the parameterized templates to have the full password spelled out per-device.

Highlighted
Beginner

Re: Using parameterized template values for a partial command va

Thanks Joseph,

I thought that might be the case.

I actually moved the remainder of the password to the GLOBAL section of the parameter file as a paramter. The matcher does find this and it works fine as :

       username Store$StoreNum password 0 $VPNPwdPfx&VPNPwdSfx

Cheers,

Don

Highlighted
Hall of Fame Cisco Employee

Re: Using parameterized template values for a partial command va

The matcher code works on Perl regular expression word boundaries.  See http://www.regular-expressions.info/wordboundaries.html for more details on how this type of matching works.  As you can see, the '_' character is considered a word character, so that is why the original regexp did not work.

CreatePlease to create content
Content for Community-Ad
July's Community Spotlight Awards