Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!cbatt!ucbvax!hplabs!amdahl!howard From: howard@amdahl.UUCP Newsgroups: comp.sys.mac Subject: Re: xbin is great, but it could be even better... Message-ID: <6238@amdahl.UUCP> Date: Mon, 13-Apr-87 20:43:35 EST Article-I.D.: amdahl.6238 Posted: Mon Apr 13 20:43:35 1987 Date-Received: Wed, 15-Apr-87 05:02:08 EST References: <1280@midas.TEK.COM> Reply-To: howard@amdahl.UUCP (Howard C. Simonson) Organization: Amdahl Corp, Sunnyvale CA Lines: 63 Keywords: xbin, suggestions for improvement, script, automate Summary: Oh what the heck, here's a goodie for ya I should have posted this eons ago. Here at the old Corporation, I have been grabbing up the various net goodies and been archiving them for our users out on disk for some time now. As a rule, I strip off any preamble for a description file in the directory, get rid of anything that isn't binhex (that include the blank line after the line saying "convert me with binhex4.0") and I compress the file; thereby creating say, DiskInfo1.43.Z, in an appropriate directory. When users wish to download something, they typically use MacTerminal or the highly praised Versaterm emulators and execute the following script which I have called Zacput on the mainframe (yes I mean mainframe). So here is the script, its real raw, I wrote it ages ago, it worked, I never bothered to improve it. I was going to enhance it to recognize pack files ("z" suffix) but never found the need. If someone wants to make improvements and ship it back out to everyone, mail it back and I will act as the clearing house. I place it in the Public Domain (magnanimous of me, eh). --------------cut cut cut cut OUCH! #$%&*& damn scissors ----------------------- : # Shellscript for transmitting a file(s) to a Macintosh via macput. # File is in compress format (.Z); is unpacked, xbin'ed and macput # Upon termination of the operation, the Macintosh bell will ring # two times. # if [ $# = 0 ] ; then echo "$0: expected the filename of a compress(1) file as an argument" exit 1 fi owd=`pwd` mkdir /usr/mac/tmp/$$ || exit 1 for f in $* do f=`basename $f .Z` if [ $f = "-" ] ; then echo "$0: does not accept compress(1) files from standard input, continuing" elif [ ! -r $f.Z ] ; then echo "$0: could not find $f.Z, continuing" elif zcat $f | ( cd /usr/mac/tmp/$$ ; xbin -n $f - 2>/dev/null ) ; then cd /usr/mac/tmp/$$ echo "Now sending the binary file: $f" mesg n /usr/mac/bin/macput $f mesg y else zcat $f > /usr/mac/tmp/$$/$$.text cd /usr/mac/tmp/$$ echo "Now sending the text file: $f" mesg n /usr/mac/bin/macput -u -n $f /usr/mac/tmp/$$/$$.text mesg y fi cd $owd done rm -rf /usr/mac/tmp/$$ ascii bel bel # ------------------------- End Of Script -------------------------------------- -- "Plan for the future because that's where you Howard C. Simonson are going to spend the rest of your life." {hplabs,ihnp4,nsc}!amdahl!howard - Mark Twain - [ The disclaimer for this message may be found in my next article ]