I knew all along, what you where trying to discribe. You, howver, have failed to even look at any of the posts I have sent for a solution.
As stated, we will help people along the way, but we will not tell them exactly how to fix it. Not when it is blindingly obvious how to fix it.
Lets make things a little more simple.
1:
Code: Select all
set var "test <CODE>"
regsub -all -- "<CODE>" $var "test" var
Code: Select all
set var "test"
regsub -all -- "<CODE>" $var "test" test
Aplying this to you script
Code: Select all
set var "http://<IP>/channel"
regsub -all -- "<IP>" $var "192.168.254.1" var
Version 2 however, does not change the avlue of $var, thus, the substitution can take place many times, dynamicaly updating the output.
Apply this theory to both your script, and the mini script's above, and you will see, that the substiture can be made many times.
NOTE: This thread is becoming a severe waste of time. While all scripters lives begin as a newcomer, with very little knowledge. They usualy attempt to read things through, and/or try things themselves.
As this thread has become pathetic (due tot he fact, the answer has been repeated time and time again, refrased in allmost everyway possible), it will be locked next time anything is posted to it.