Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to get the next ip for given ip
ex: 10.10.10.1 -> 10.10.10.2
ex: 10.10.10.255 -> 10.10.11.0

Answer Posted / gowri

set ip "10.10.10.1"
lappend result [ regexp (\[0-9]+\) (\[0-9]+\) (\[0-9]+\) (\[0-9]+\) $ip match val1 val2 val3 val4]
puts $val1
puts $val2
puts $val3
puts $val4
if {$val1 > 255} {
set val1 0
incr val2
if {$val2 > 255 } {
set val2 0
incr val3
if {$val3 >255} {
set val3 0
incr val4
if {$val4 > 255} {
set val4 0

}}} else {
incr val5
lappend result1 "$val1.$val2.$val3.$val4"
puts $result1

}

Is This Answer Correct ?    3 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

No New Questions to Answer in this Category !!    You can

Post New Questions

Answer Questions in Different Category