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

Using parameterized template values for a partial command value

donu
Level 1
Level 1

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

3 Replies 3

Joe Clarke
Cisco Employee
Cisco Employee

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.

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

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.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: