home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / ad2c < prev    next >
Encoding:
Text File  |  1998-04-08  |  819 b   |  42 lines

  1. #!/bin/sh
  2. #
  3. #    ad2c : Convert app-defaults file to C strings decls.
  4. #
  5. #    George Ferguson, ferguson@cs.rcohester.edu, 12 Nov 1990.
  6. #    19 Mar 1991 : gf
  7. #        Made it self-contained.
  8. #    6 Jan 1992 : mycroft@gnu.ai.mit.edu (Charles Hannum)
  9. #        Removed use of "-n" and ":read" label since Gnu and
  10. #        IBM sed print pattern space on "n" command. Still works
  11. #        with Sun sed, of course.
  12. #    7 Jan 1992: matthew@sunpix.East.Sun.COM (Matthew Stier)
  13. #        Escape quotes after escaping backslashes.
  14. #
  15. #   This file has been included with permission from the author.
  16. #   Fri Mar  6 01:40:58 PST 1998
  17. #
  18.  
  19. sed '
  20. /^!/d
  21. /^$/d
  22. s/\\/\\\\/g
  23. s/\\$//g
  24. s/"/\\"/g
  25. s/^/"/
  26. : test
  27. /\\$/b slash
  28. s/$/",/
  29. p
  30. d
  31. : slash
  32. n
  33. /^!/d
  34. /^$/d
  35. s/"/\\"/g
  36. s/\\\\/\\/g
  37. s/\\n/\\\\n/g
  38. s/\\t/\\\\t/g
  39. s/\\f/\\\\f/g
  40. s/\\b/\\\\b/g
  41. b test' "$@"
  42.