[net.sources.mac] macsend - csh version plus features

liberte@uiucdcs.Uiuc.ARPA (07/29/85)

For all you new folks, I find this handy for transferring lots of files to
the Mac using MacTerminal.  

Dan LaLiberte
liberte@uiucdcs.Uiuc.ARPA
ihnp4!uiucdcs!liberte

-----------not a shar file----------------------
#! /bin/csh -f

# Shellscript for transmitting groups of files to a Macintosh via macput.
# Usage: macsend file ...
#
# Mac files may be in three parts created by xbin: .data, .info, .rsrc
# All other files will be sent as text files using the -u option.
# If files with the added suffixes (.data, .info, and .rsrc) don't exist, 
# macsend checks if the filename includes a suffix and only processes the
# three parts once.  You, therefore, cannot send just one of the three parts.
# 
# Directories and files that are unreadable are ignored.
# Wildcards may be used.  Thus, to transmit all files beginning with "MacDev"
#	macsend MacDev*
#
# Upon termination of the operation, the Macintosh bell will ring.
#
# 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
#
# Converted to csh, added features June 16, 1985 by
# Daniel LaLiberte
# University of Illinois, Urbana-Champaign
# Department of Computer Science
# ihnp4!uiucdcs!liberte

mesg n	# no interruptions
set noglob

foreach f ($*)
	unset flag
	
	if (-d $f || ! -r $f) continue

	if ( $f =~ *.data ) then
		set f = $f:r
	else if ( $f =~ *.rsrc || $f =~ *.info) continue
	endif

	if  ( -r $f.data  &&  -r $f.info && -r $f.rsrc ) then
		set flag = ()
	else
		set flag = -u
	endif 

	if ( $?flag ) then
		echo " macput $flag $f"
		/mnta/2/staff/liberte/MAC/bin/macput $flag $f
	endif
end

echo " Downloading is done! "
mesg y