From owner-freebsd-current Tue Mar 14 10:58:28 2000 Delivered-To: freebsd-current@freebsd.org Received: from awfulhak.org (tun.AwfulHak.org [194.242.139.173]) by hub.freebsd.org (Postfix) with ESMTP id B5DF237B791 for ; Tue, 14 Mar 2000 10:58:16 -0800 (PST) (envelope-from brian@Awfulhak.org) Received: from hak.lan.Awfulhak.org (root@hak.lan.awfulhak.org [172.16.0.12]) by awfulhak.org (8.9.3/8.9.3) with ESMTP id SAA26899; Tue, 14 Mar 2000 18:57:57 GMT (envelope-from brian@hak.lan.Awfulhak.org) Received: from hak.lan.Awfulhak.org (brian@localhost [127.0.0.1]) by hak.lan.Awfulhak.org (8.9.3/8.9.3) with ESMTP id SAA01299; Tue, 14 Mar 2000 18:57:56 GMT (envelope-from brian@hak.lan.Awfulhak.org) Message-Id: <200003141857.SAA01299@hak.lan.Awfulhak.org> X-Mailer: exmh version 2.1.1 10/15/1999 To: Garrett Wollman Cc: Yoshinobu Inoue , freebsd-current@FreeBSD.org, brian@hak.lan.Awfulhak.org Subject: Re: IPv6 setup... In-Reply-To: Message from Garrett Wollman of "Mon, 13 Mar 2000 10:13:31 EST." <200003131513.KAA35922@khavrinen.lcs.mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 14 Mar 2000 18:57:56 +0000 From: Brian Somers Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > < 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)) Or if you wanna be really slick myaddr=24.113.25.85 eval IFS=".$IFS" printf '2002:%02x%02x:%02x%02x:\\n' $myaddr :*P > -GAWollman > > -- > Garrett A. Wollman | O Siem / We are all family / O Siem / We're all the same > wollman@lcs.mit.edu | 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 -- Brian Don't _EVER_ lose your sense of humour ! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message