uuencode 1.2 KB

12345678910111213141516171819202122232425262728
  1. #------------------------------------------------------------------------------
  2. # $File: uuencode,v 1.9 2021/11/13 17:48:10 christos Exp $
  3. # uuencode: file(1) magic for ASCII-encoded files
  4. #
  5. # The first line of xxencoded files is identical to that in uuencoded files,
  6. # but the first character in most subsequent lines is 'h' instead of 'M'.
  7. # (xxencoding uses lowercase letters in place of most of uuencode's
  8. # punctuation and survives BITNET gateways better.)
  9. 0 regex/1024 \^begin\040[0-7]{3}\040
  10. >&0 regex/256 [\012\015]+M[\040-\140]{60}[\012\015]+ uuencoded text
  11. >&0 regex/256 [\012\015]+h[0-9A-Za-z\053\055]{60}[\012\015]+ xxencoded text
  12. >&0 default x uuencoded or xxencoded text
  13. >&0 string >\0 \b, file name "%s"
  14. # btoa(1) is an alternative to uuencode that requires less space.
  15. 0 search/1 xbtoa\ Begin btoa'd text
  16. # ship(1) is another, much cooler alternative to uuencode.
  17. # Greg Roelofs, newt@uchicago.edu
  18. 0 search/1 $\012ship ship'd binary text
  19. # bencode(8) is used to encode compressed news batches (Bnews/Cnews only?)
  20. # Greg Roelofs, newt@uchicago.edu
  21. 0 search/1 Decode\ the\ following\ with\ bdeco bencoded News text
  22. # GRR: handle BASE64