Set ip address as 10.30.20.1
write a script to replace the 30 with 40 ?
Answer Posted / indu sharma
In above answer if you have IP like 10.30.30.1 then it replace for all 30 with 40.But here i guess intention is just to replace one octet with 40.So following solves that issue:
set a 10.30.2.1
set b [ string replace $a 3 4 40 ]
puts $b
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
No New Questions to Answer in this Category !! You can
Post New Questions
Answer Questions in Different Category