home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: alt.hackers
- Path: sparky!uunet!spool.mu.edu!sol.ctr.columbia.edu!destroyer!terminator!honey
- From: honey@citi.umich.edu (Peter Honeyman)
- Subject: Re: tftpboot file creation
- Message-ID: <1992Sep14.035742.29693@terminator.cc.umich.edu>
- Sender: news@terminator.cc.umich.edu (Usenet Owner)
- Reply-To: honey@citi.umich.edu
- Organization: Center for Information Technology Integration, Univ of Michigan
- References: <1992Sep13.155507.17974@sol.ctr.columbia.edu>
- Date: Mon, 14 Sep 1992 03:57:42 GMT
- Approved: just because
- Lines: 30
-
- here is a script that calculates the inverse of yours.
-
- this is a hack, but i had it lying around.
-
- usage: xaddr 8dd38063
-
- #!/bin/sh
-
- echo $1|tr '[A-Z]' '[a-z]'|awk '
- {
- l = length($1);
- a8 = substr($1, l, 1);
- a7 = substr($1, l-1, 1);
- a6 = substr($1, l-2, 1);
- a5 = substr($1, l-3, 1);
- a4 = substr($1, l-4, 1);
- a3 = substr($1, l-5, 1);
- a2 = substr($1, l-6, 1);
- if (l == 7)
- a1 = 0;
- else
- a1 = substr($1, 1, 1);
-
- A1 = (index("0123456789abcdef", a1) - 1) * 16 + index("0123456789abcdef", a2) - 1;
- A2 = (index("0123456789abcdef", a3) - 1) * 16 + index("0123456789abcdef", a4) - 1;
- A3 = (index("0123456789abcdef", a5) - 1) * 16 + index("0123456789abcdef", a6) - 1;
- A4 = (index("0123456789abcdef", a7) - 1) * 16 + index("0123456789abcdef", a8) - 1;
-
- print A1 "." A2 "." A3 "." A4
- }'
-