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

  1. Newsgroups: alt.hackers
  2. Path: sparky!uunet!stan!imp
  3. From: imp@solbourne.com (Warner Losh)
  4. Subject: Re: tftpboot file creation
  5. Message-ID: <BuKrn1.LKD@solbourne.com>
  6. Organization: Solbourne, User Interface Group
  7. References: <1992Sep13.155507.17974@sol.ctr.columbia.edu> <RENS.92Sep13224403@lorax.shearson.com>
  8. Date: Mon, 14 Sep 1992 15:42:37 GMT
  9. Approved: yes
  10. Lines: 14
  11.  
  12. In article <RENS.92Sep13224403@lorax.shearson.com> rens@shearson.com writes:
  13. >hex=`echo $1 | awk -F. '{printf("%x%x%x%x\n",$1,$2,$3,$4)}' | tr a-f A-F`
  14.  
  15. if $1 = 1.2.3.4, then you get the wrong answer by doing it this way.
  16. You need to have "%02x" for each of the %x's to get the right answer.
  17.  
  18. ObHack:
  19.     Using cpp to simulate templates when I can't use templates for
  20. the problem at hand.  Eliminated 2100 of 7500 lines of code this way.
  21.  
  22. Warner
  23. -- 
  24. Warner Losh        imp@Solbourne.COM
  25. I've almost finished my brute force solution to subtlety.
  26.