<<On Mon, 13 Mar 2000 10:22:08 +0900, Yoshinobu Inoue <[EMAIL PROTECTED]> said:

>   echo 24.113.25.85 | sed -e s/"\."/" "/g | awk '{$5 = $1*256 + $2; $6 = $3*256 + 
>$4; printf "2002:%x:%x:\n", $5, $6}'

Or, without only one extra process:

myaddr=24.113.25.85
OIFS="$IFS"
IFS=".$IFS"
set $myaddr
IFS="$OIFS"
printf "2002:%x:%x:\n" $(($1 * 256 + $2)) $(($3 * 256 + $4))

-GAWollman

--
Garrett A. Wollman   | O Siem / We are all family / O Siem / We're all the same
[EMAIL PROTECTED]  | O Siem / The fires of freedom 
Opinions not those of| Dance in the burning flame
MIT, LCS, CRS, or NSA|                     - Susan Aglukark and Chad Irschick


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to