Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 
New Member

CSS11500 scripting "REPLACE_TEXT" function


does somebody know how to include the function "replace_text" in a css script? The script "commit_vip_redundancy" for example makes extensive use of this function. But when I try to run a little script that uses this function, the CSS says "function REPLACE_TEXT undefined".

Any information on this function is welcome. Thanks!



CSS1# sho script scrtest.txt

sho run | grep "ip address" > tmp.cfg

set localIP ""

set backupIp ""

set SUB_STRING_IP "ip address"

function REPLACE_TEXT call "tmp.cfg localIp backupIp 0 SUB_STRING_IP"

CSS1# script play scrtest.txt

CSS1# set localIP ""

CSS1# set backupIp ""

CSS1# set SUB_STRING_IP "ip address"

CSS1# function REPLACE_TEXT call "tmp.cfg localIp backupIp 0 SUB_STRING_IP"

Error undefined variable.

function:REPLACE_TEXT undefined.

Error in script playback line:5

>>>function REPLACE_TEXT call "tmp.cfg localIp backupIp 0 SUB_STRING_IP"


Script Playback cancelled.


Re: CSS11500 scripting "REPLACE_TEXT" function

There are 2 ways you could do this.

One is to copy the script into an ftp server and modify it and then copy it back to the CSS box. The existing script would be replaced and the new script would play. Use the copy script ftp images command to do this.

If you used a text editor, save the script with any filename and extension you wish with a maximum of 32 characters. Then, use the copy command to move the script file to the CSS.

Another is to use the script record command to record command entries in a script file. When you finished creating the file, Ctrl-C out of the script record command mode. To run the script use the script play command.

Hope this helps!

CreatePlease to create content