home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / alt / hackers / 1414 < prev    next >
Encoding:
Text File  |  1992-09-13  |  1.4 KB  |  44 lines

  1. Newsgroups: alt.hackers
  2. Path: sparky!uunet!spool.mu.edu!sol.ctr.columbia.edu!destroyer!terminator!honey
  3. From: honey@citi.umich.edu (Peter Honeyman)
  4. Subject: Re: tftpboot file creation
  5. Message-ID: <1992Sep14.035742.29693@terminator.cc.umich.edu>
  6. Sender: news@terminator.cc.umich.edu (Usenet Owner)
  7. Reply-To: honey@citi.umich.edu
  8. Organization: Center for Information Technology Integration, Univ of Michigan
  9. References:  <1992Sep13.155507.17974@sol.ctr.columbia.edu>
  10. Date: Mon, 14 Sep 1992 03:57:42 GMT
  11. Approved: just because
  12. Lines: 30
  13.  
  14. here is a script that calculates the inverse of yours.
  15.  
  16. this is a hack, but i had it lying around.
  17.  
  18. usage:  xaddr 8dd38063
  19.  
  20. #!/bin/sh
  21.  
  22. echo $1|tr '[A-Z]' '[a-z]'|awk '
  23.   {
  24.         l = length($1);
  25.         a8 = substr($1, l, 1);
  26.         a7 = substr($1, l-1, 1);
  27.         a6 = substr($1, l-2, 1);
  28.         a5 = substr($1, l-3, 1);
  29.         a4 = substr($1, l-4, 1);
  30.         a3 = substr($1, l-5, 1);
  31.         a2 = substr($1, l-6, 1);
  32.         if (l == 7)
  33.                 a1 = 0;
  34.         else
  35.                 a1 = substr($1, 1, 1);
  36.  
  37.         A1 = (index("0123456789abcdef", a1) - 1) * 16 + index("0123456789abcdef", a2) - 1;
  38.         A2 = (index("0123456789abcdef", a3) - 1) * 16 + index("0123456789abcdef", a4) - 1;
  39.         A3 = (index("0123456789abcdef", a5) - 1) * 16 + index("0123456789abcdef", a6) - 1;
  40.         A4 = (index("0123456789abcdef", a7) - 1) * 16 + index("0123456789abcdef", a8) - 1;
  41.  
  42.         print A1 "." A2 "." A3 "." A4
  43.   }'
  44.