Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!leah!rpi!batcomputer!cornell!uw-beaver!teknowledge-vaxc!unix!hplabs!hpfcdc!hpfcmgw!hpfcse!hpuflfa!ronw From: ronw@hpuflfa.HP.COM (Ron Williams) Newsgroups: comp.sys.hp Subject: Re: UUencode/decode Message-ID: <140003@hpuflfa.HP.COM> Date: 1 Aug 89 13:54:07 GMT References: Organization: Hewlett-Packard, SSR-Ft. Lauderdale Lines: 51 > Is there an HP-UX analogue to uuencode and uudecode? I have > seen these commands on Berkeley systems and assume there must be a way > to "ascii-ize" binary files with HP-UX. Perhaps I assume too much? My > system particulars are: HP-UX 3.1 on a 9000/835. > > Thanks in advance. >-- ><<< Len Saaf saaf@joker.optics.rochester.edu >>> >---------- For the most part HP'ers *SANITIZE* their file that might have non-printing characters (or binary data or 8-bit info) for subsequent e-mail by using the utility 'shar'. I do happen to have a copy of uudecode (sorry, no uuencode) that seems to work (its extremely short). ------------------------------------------------------------------------------ #include #define DEC(c) (((c) - ' ') & 077) main() { int n; char dest[128], a,b,c,d; scanf("begin %o ", &n); gets(dest); if (freopen(dest, "w", stdout) == NULL) { perror(dest); exit(1); } while ((n=getchar()) != EOF && (n=DEC(n))!=0) { while (n>0) { a = DEC(getchar()); b = DEC(getchar()); c = DEC(getchar()); d = DEC(getchar()); if (n-- > 0) putchar(a << 2 | b >> 4); if (n-- > 0) putchar(b << 4 | c >> 2); if (n-- > 0) putchar(c << 6 | d); } n=getchar(); } exit(0); } ------------------------------------------------------------------------------ Ron Williams HP Ft. Lauderdale ronw@hpfcse ------------ TEL: T-938-2278 {hpfcse}!hpuflfa!ronw FAX: T-938-2293 COMSYS: 3179 AREA CODE: 305 HPDESK: Ron Williams / HP3179/07