Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

uudecode front-end?

0 views
Skip to first unread message

Richard Foulk

unread,
May 10, 1991, 12:16:29 AM5/10/91
to
Anyone have a fairly robust uudecode front-end? Something you can
give a multi-part posting to and have it remove the cruft before
sending it to uudecode?

Thanks.


--
Richard Foulk ric...@pegasus.com

Randal L. Schwartz

unread,
May 10, 1991, 12:06:19 PM5/10/91
to
In article <1991May10....@pegasus.com>, richard@pegasus (Richard Foulk) writes:
| Anyone have a fairly robust uudecode front-end? Something you can
| give a multi-part posting to and have it remove the cruft before
| sending it to uudecode?

I use "uumerge", based in part on an example in The Book. It's not a
uudecode front end... it does the whole decode right inside Perl,
thanks to unpack('u'). Here:

################################################## snip
#!/usr/bin/perl
while (<>) {
$sawbegin++, last if ($mode,$file) = /^begin\s*(\d*)\s*(\S*)/;
}
die "missing begin" unless $sawbegin;
open(OUT,"> $file") if $file ne "";
while (<>) {
$sawend++, last if /^end/;
s/[a-z]+$//; # handle stupid trailing lowercase letters
next if /[a-z]/;
next unless int((((ord() - 32) & 077) + 2) / 3) == int(length() / 4);
print OUT unpack("u", $_);
}
die "missing end" unless $sawend;
chmod oct($mode), $file;
exit 0;

################################################## snip

print unpack("u",pack("h*", <<'-- '))
9323745335d3221214b364d545a362532582521254c3640504a3625234a3655325b2060606a0
--
/=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\
| on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III |
| mer...@iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn |
\=Cute Quote: "Intel: putting the 'backward' in 'backward compatible'..."====/

25362-roe mcburnett(H053)m000

unread,
May 15, 1991, 8:50:22 AM5/15/91
to
In article <1991May10....@pegasus.com>, richard@pegasus (Richard Foulk) writes:
| Anyone have a fairly robust uudecode front-end? Something you can
| give a multi-part posting to and have it remove the cruft before
| sending it to uudecode?


Here is something that I put together that I use. While I am reading
news, if I see something that I want to save, I use the following:

/article/s filename:j

to find all the articles that have the same heading, save them in
"filename" and then junk the articles.

When I want to uudecode it I use:

================cut here================================
#! /d3/SWITCH/bin/perl -S
#extract will scan for uuendcoded stuff and feed it to uudecode
open(_uud,"|uudecode");
line: while (<>) {
if(/^BEGIN/){
$p = 'y';
next line;
}
if(/^END/){
$p = 'n';
}
if($p eq 'y'){
print _uud $_;
}
}
================cut here

As you can see there are no error checks or other embelishments. Feel
free (but please let me know if you come up with something better.

-Roe


Roe D McBurnett III Bellcore (908)699-2273 rd...@chaucer.cc.bellcore.com
#insert <std.disclamer>

0 new messages