How to Swap 30 & 40 in IP address 192.30.40.1 using TCL
script?

Answer Posted / hereiam

set x 192.30.40.1
set srcStr {([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)}
regexp $srcStr $x - d1 d2 d3 d4
regsub $srcStr $x "$d1.$d3.$d2.$d1" x

puts $x

Is This Answer Correct ?    14 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Hi all, Is there any certification exams available for TCL and Perl. If so please let me know, my mailid is vpbharathi@gmail.com. Thanks in advance, Bharathi.P

2612