[net.sources.mac] Macsend

info-mac@uw-beaver (04/30/85)

From: barry@playfair (Barrett P. Eynon)

The version of macsend (the unix shell script to intelligently send multiple
files through macput) recently submitted by Chris Borland adds a useful
capability for grouping the file triples produced by macget or xbin (.data,.
.rsrc,.info) and sending them together. Unfortunately his version disables the
ability to send sole .rsrc or .data files, and also can be misled by file 
expansions. The enclosed version of macsend has both capabilities, and triples
can either be referenced by prefix or by a list (e.g. f or f.*).

-Barry Eynon (playfair!barry@Score)

[ This version resides in unix-macsendv2.sh, and Borton's in now in 
  unix-macsend.sh -jma ]

#! /bin/sh
# Shellscript for transmitting groups of files to a Macintosh via macput.
# Invokes /bin/sh upon entry.
# Files in three parts as created by xbin or macget (.rsrc, .data, .info)
# will be sent as one unit. ( References to such files may either be by
# prefix or by complete list (e.g. f or f.* )
# Otherwise:
# Files with the extension .rsrc will be sent as resource files using
#	the -r option.
# Files with the extension .data will be sent as data files using
#	the -d option.
# 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
#
# Further modifications to cover more cases 4/27 by
# Barry Eynon (barry!playfair@Score)
#
mesg n
for f in $*
do
	case $f in
	*.data) g=`basename $f .data`
		if [ -r $g.data ] && [ -r $g.rsrc ] && [ -r $g.info ]
		then
			echo -n " "
		elif [ -f $f ] && [ -r $f ]
		then
			echo " macput -d $f"
			macput -d $f
		fi
	;;
	*.rsrc) g=`basename $f .rsrc`
		if [ -r $g.data ] && [ -r $g.rsrc ] && [ -r $g.info ]
		then
			echo -n " "
		elif [ -f $f ] && [ -r $f ]
		then
			echo " macput -r $f"
			macput -r $f
		fi
	;;
	*.info) g=`basename $f .info`
		if [ -r $g.data ] && [ -r $g.rsrc ] && [ -r $g.info ]
		then
			echo " macput $g"
			macput $g
		elif [ -f $f ] && [ -r $f ]
		then
			echo " macput -u $f"
			macput -u $f
		fi
	;;
	*)
		if [ -r $f.data ] && [ -r $f.rsrc ] && [ -r $f.info ]
		then
			echo " macput $f"
			macput $f
		elif [ -f $f ] && [ -r $f ]
		then
			echo " macput -u $f"
			macput -u $f
		fi
	;;
	esac
done
echo -n " "
echo "Downloads done!"
echo -n 
echo -n 
echo -n 
mesg y
p