Dec 312009
Convert IP address to HEX in Bash script
Answer:
The following Bash script is useful to convert IP address to HEX
#!/bin/sh
IP_ADDR=192.168.1.234
printf '%02X' ${IP_ADDR//./ }; echo
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
Convert IP address to HEX in Bash script
Answer:
The following Bash script is useful to convert IP address to HEX
#!/bin/sh
IP_ADDR=192.168.1.234
printf '%02X' ${IP_ADDR//./ }; echo