[net.sources.mac] macsend for xbin and macput

ix924@sdcc6.UUCP (Chris Borton) (04/26/85)

     Here is a modification of the macsend shellscript posted a while ago
on the net.  The original macsend generated -rdu options for macput depending
upon the file extension, but this doesn't work with macput for xbin'd files.
(For those of you unfamiliar with xbin, it's a C program that does the job of
BinHex on UNIX, and creates three files from the file given: <file>.rsrc, <file>.data, and <file>.info.  The command macput without any options looks for those three files and downloads the final binary version, ready to run.)
     You can give it any number of files (including wild cards) and it will 
determine whether xbin has been run on them.  If so, it uses macput for a binary
download; if not, it uses macput -u, assuming a text file.  After it is done it beeps the Mac three times (to wake you up) and prints "Downloads done!"
I hope this is useful--please mail any comments, bugs, or whatever to me 
directly.

Chris Borton
sdcsvax!sdcc6!ix924

<----------------------------CUT HERE------------------------------->
#! /bin/sh
# Shellscript for transmitting groups of files to a Macintosh via macput.
# Invokes /bin/sh upon entry.
# Files must be in three parts created by xbin : .rsrc, .data, .info
# 
# All other files will be sent as text files using the -u option.
# This shellscript will ignore directories and files that are unreadable.
# Wildcards may be used.  Thus, to transmit all files beginning with
#	a capital letter, use "macsend [A-Z]*"
# Upon termination of the operation, the Macintosh bell will ring
#	three times.  This is your clue to wake up and see what you got!
# Be sure that macput is in your path, otherwise the shellscript won't work!
#
# This shellscript is based on the original macsend.
#	
# Modifications done on April 20, 1985 by 
#		
# Chris Borton 
# University of California at San Diego.
# Undergraduate CS
# sdcsvax!sdcc6!ix924
#
mesg n
for f in $*
do
	if [ -f $f.* ]  && [ -r $f.* ] 
	then 
		if [ -r *.data ] && [ -r *.rsrc ] && [ -r *.info ] 
		then
			echo " macput $f"
			macput $f
		fi
	fi
	if [ -f $f ] && [ -r $f ]
	then 
		echo " macput -u $f"
		macput -u $f
	fi
done
echo -n " "
echo "Downloads done!"
echo -n 
echo -n 
echo -n 
mesg y