2015-08-17

TCL, MAC remove ":", and call back ":".

Example MAC is 001122998877
Change example MAC to 00:11:22:99:88:77

set macEth0 "001122998877"

for { set i 0 } {$i < 6 } { incr i } {
      set temp [format "%s" [string range $macEth0 [expr $i * 2] [expr $i * 2 + 1]]]
      append macEth0 "$temp"
      if { $i == 5 } { break }
      append macEth0 ":"
}

puts "Debug: macEth0 ==> $macEth0"


Remove MAC symbol ":"

set var_mac ""
set sfis_macEth1 ""

set var_mac [string map {: ""} $macEth0]
set sfis_macEth1 [string map {: ""} $macEth1]

puts "var_mac = $var_mac"
puts "sfis_macEth1 = $sfis_macEth1"