I have a mysql database where in the NETWORK table, the IP_ADDRESS field is varchar and holds standard IP addresses in different lengths like 184.108.40.206 or 220.127.116.116, or 123.456.789.123 etc. I need another field (i.e. IP_ADDRESS_DECIMAL) to hold their decimal values. I have seen ip2long in php but I am not sure how to use that......an ordinary bash, perl script with similar functionality will work for me. I need to put my script in a cron job. Some bash/perl script like this:
mysql -u root -pmypass mydatabase -e "UPDATE NETWORK SET IP_ADDRESS_DECIMAL = Somefunction(IP_ADDRESS);
Thanks very much.