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>
<CMDPARAM NAME = VPNPwdPfx>
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
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.
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
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.