Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!seismo!gatech!hao!boulder!sunybcs!ugmiker
From: ugmiker@sunybcs.uucp (Michael Reilly)
Newsgroups: comp.sys.amiga
Subject: Re: uudecode blues
Message-ID: <3893@sunybcs.UUCP>
Date: Mon, 6-Jul-87 15:37:38 EDT
Article-I.D.: sunybcs.3893
Posted: Mon Jul  6 15:37:38 1987
Date-Received: Tue, 7-Jul-87 06:29:06 EDT
References: <736@utflis.UUCP>
Sender: nobody@sunybcs.UUCP
Reply-To: ugmiker@joey.UUCP (Michael Reilly)
Distribution: na
Organization: SUNY/Buffalo Computer Science
Lines: 106
Summary: shell scripts

In article <736@utflis.UUCP> wayne@utflis.UUCP (Wayne Young) writes:
>I am having problems transferring large binary files to my Amiga
>from a 4.2BSD UNIX Vax.  These files were pulled off the net in a 
>uuencoded format, compressed, stored, uncompressed, and uudecoded. 
>They were then xmodem'ed and/or kermited to the Amiga, which refused 
>to believe that these were object files.
>
>wayne

your problem might be compressing uuencoded files,try decoding the files before
you compress them, or arc them.  I find arc the best packaging system for send-
ing files, it protects them(sort of... I think..).
Here are two shell scripts I use for doing all of my sharing, uudecoding, and 
arcing up for transfer to the amiga from a vax 11/785 running unix 4.3BSD.
The first script does all the work in a subdirectory of the directory you call
the command from, the second one (for you quota conscious people) uses the 
/tmp directory to do all the work.  They both do the same thing, but one in
tmp and one not.  
	All you have to do is pick where you want the file manipulation done,
then run the script with the name of the file just taken off the net.  The only
thing that must be done manually (as of now) is that you must cut off the header
of the file, ie, cut where person says "cut here".  I like to run it in the 
background and forget about it, I hated always having to shar, then look for
files with .uue at the end, then arcing everything together, now just one 
command does it all.  I am (hopefully soon) going to fix the script so it cuts
off the header, but that could get messy because everyone says "cut here"  
differently...

	hope you find these helpful

					mike(r)

p.s. the files are heavily(too heavily) commented, wipe out the comments and the
     files are tiny.




---CUT HERE---THIS DOES WORK IN SUBDIR---CUT HERE---THIS DOES WORK IN SUBDIR---
#!/bin/csh
mkdir $1.dir
cp $1 $1.dir/.
# make a subdirectory and copy the main file to it , this  makes arcing 
# all files in the directory easier.
cd $1.dir
chmod u+x $1
$1
rm $1
# get into the directory, make the shar executable, then execute it and remove
# the shar file.
set uus = `ls *.uue *.uu`
foreach file ($uus)
 uudecode $file
 rm $file
end 
# any uuencoded file must be uudecode and then the .uue/.uu file removed to make
# arcing easier  
arc an {$1}.arc *
mv {$1}.arc ../{$1}.arc
# add all files to arc named as the original filename with the .arc postfix
# then mv that file to the original directory.
cd ..
rm $1.dir/*
rmdir $1.dir
# then move up to the parent directory and remove the all the 
# files in the lower directory,then remove that lower directory to keep
# things clean, and keep your quota down.

----CUT HERE----THIS DOES WORK IN /TMP ----CUT HERE----THIS DOES WORK IN /TMP---
#!/bin/csh
mkdir /tmp/$1.dir
cp $1 /tmp/$1.dir/.
# make a directory in /tmp and copy the main file to it , this  makes arcing 
# all files in the directory easier.
cd /tmp/$1.dir
chmod u+x $1
$1
rm $1
# get into the directory, make the shar executable, then execute it and remove
# the shar file.
set uus = `ls *.uue *.uu`
foreach file ($uus)
 uudecode $file
 rm $file
end 
# any uuencoded file must be uudecoded and then the .uue/.uu 
# arcing easier file removed to make
arc an {$1}.arc *
mv {$1}.arc ~/{$1}.arc
# add all files to arc named as the original filename with the .arc postfix
# then mv that file to the original directory.
cd 
rm /tmp/$1.dir/*
rmdir /tmp/$1.dir
# then move up to the original directory and remove the all the 
# files in the lower directory,then remove that /tmp directory to keep
# things clean.
================================================================================
        	             Mike Reilly                              //
                             ---- ------                             // 
                   University of Buffalo Computer Science      AMIGA//  
                   ---------- -- ------- -------- -------        \\//  
                   csnet:	ugmiker@buffalo.CSNET             \/     
                   uucp:	..!{nike|watmath,alegra,decvax}!sunybcs!ugmiker
                   BITNET:	ugmiker@sunybcs.BITNET, v107ln7z@ubvmsa.bitnet
================================================================================