#!/usr/bin/perl
#
#   aut file... 
#
# Atob+Uncompress+tar
#
# This collects a set of  files  created  by  tcb,  feeds  them  to  atob  to
# reconstruct  a compressed tar archive, runs uncompress on that to get a tar
# archive, and then runs tar on the result to extract the files.  You  should
# probably  do this in a clean directory, to avoid surprises like overwriting
# existing files.

#open(aout,">aout");
open(data,"| atob | uncompress | tar xvpf -")
	|| die "Can't run tar|compress|uuencode";
for (<>) {
	if (/^---end beef/) {
		$in = 0;
		next;
	} elsif (/^---start beef/) {
		$in = 1;
		next;
	} elsif (/^xbtoa Begin/) {
		$in = 1;
	}
#	print aout if $in;
	print data if $in;
}
print "Remember to remove the tcb files: @ARGV\n";

