home *** CD-ROM | disk | FTP | other *** search
/ BUG 1 / BUGCD1996_0708.ISO / pc / util / minilin / minilin.exe / USR / BIN / XX < prev    next >
Text File  |  1993-05-02  |  985b  |  22 lines

  1. #
  2. # A script to extract binary files from uudecoded files. Ignores all headers
  3. # and irrelevant stuff. Has shortfalls like all such scripts/programs but works
  4. # (almost) 100% of the time. We tested it against many such tools available
  5. # at many ftp sites and found it having higher success rate. There are
  6. # a few c-programs out there and it is slower as compared to them but it
  7. # works even in those cases when they fail to work.
  8. # The only time it will not work is that if uuencoded source file is cut up
  9. # in many pieces and LAST part contains LESS THAN 3 SOURCE lines in it and
  10. # we know that such cases (almost) never arise....guarenteed....:)
  11. #
  12. # Written by Tahir Zia Khawaja   and
  13. #            Nasir Ahmed Noor
  14. #umnoor@ccu.umanitoba.ca
  15. #umkhawaj@ccu.umanitoba.ca
  16. #
  17. awk '$0 ~ /^begin / {print $0; exit}' $1 > $$gifile
  18. egrep "^M[^a-z]" $1 >> $$gifile
  19. awk 'NR > 2 {sl=lr; lr=pr; pr=$0} $1 ~ /^end/ {print sl; print lr; print pr; exit}' $1 >> $$gifile
  20. uudecode $$gifile
  21. rm $$gifile
  22.