#From: David Johnson #Subject: getit.shar #To: macgifts@mac.archive.umich.edu #Date: Fri, 16 Jul 1993 04:01:52 -0700 (PDT) # #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create: # README # getit # getumich # prnumich # sample-input # This archive created: Fri Jul 16 03:46:57 1993 export PATH; PATH=/bin:/usr/bin:$PATH if test -f 'README' then echo shar: "will not over-write existing file 'README'" else cat << \SHAR_EOF > 'README' Well don't get too excited, this is no big hack, and mostly made of stuff I stole from here and there, basically the ftp script that is on sumex that allows auto ftping and modified version of a perl script written by Jonathan Eunice (jonathan@cs.pitt.edu) that beautifies (???) the mac digests from umich. Of course this isn't like skim.c that does almost everything for you except get the files (if you like sumex :) but it is handier IMHO for what is does do (and it doesn't involve compiling :) What *does* it do you ask? Well, this is the run down: You run out and get a unix box :-) Save a copy of the mac.archive.digest to a file. Edit the file (with your favorite editor of course), deleting any of the programs you don't want (i.e. any line starting with a '/mac/...' Save the file. Type getit filename Voila, all the files show up in a new directory. How to set it up. (for the complete moron) You sould have gotten the files: README (well I sould say so :) getit* prnumich* getumich* sample-input 1) Make sure you have perl by typing 'perl -v' 2) Move the files 'getit','prnumich', and 'getumich' to your local bin directory If you don't have a local bin dir, edit the file '.cshrc' so that there is a line that says 'set lpath = ($HOME/bin)' Now find the line that starts with 'set path = (' and ad '$lpath ' right after the '(' It should now look like 'set path = ($lpath /blah/blah/blah/... .)' Type 'mkdir $HOME/bin' then type: 'mv getit $HOME/bin' 'mv getumich $HOME/bin' 'mv prnumich $HOME/bin' 3) Edit your .netrc file so that it includes this line: machine mac.archive.umich.edu login anonymous password your@email.address Of course, substitiuting your email address for 'your@email.adress' If you don't have a .netrc file, just make one. Call it '$HOME/.netrc' and put it in your home directory. 5) Get a mac.archive.digest list. Edit it so that all programs you don't want are deleted (that is all the lines that contain '/mac/...' ). Any line that starts with a / will be seen as a program to get. Save the file (You can use the sample-input file to test getit) You might want to cut the mail headers out also (just in case :) 6) Type 'source $HOME/.cshrc' (or logout and log back in) 7) Type 'getit filename' (where filename is what you saved the edited digest as) 8) Wait You will eventually have the files in a new directory named 'new-umich-files.month-hr:min:sec' Enjoy! --DAVE (johnson@wrs.com) ps- For those more in tune to the unix god, you can set getit to look in some other places for it's files, and there's a couple of other options avail. Look in the files getit and getumich. pss- Let's be kind about when and how many files. A nice thing for you to do would be to make a script file and use the 'at' command to get the files when the archive isn't so busy ( 'man at' for those interesed). SHAR_EOF fi if test -f 'getit' then echo shar: "will not over-write existing file 'getit'" else cat << \SHAR_EOF > 'getit' #!/usr/bin/csh if $#argv == 0 then echo " Usage: getit filename" echo " GetIt v1.0 David C. Johnson (johnson@wrs.com)" exit else set INPUT = $argv[1] set SUPPORT_FILES_DIR = $HOME/bin set NEW_DIR_NAME = "new-umich-files.`date +%h-%d-%T`" mkdir $NEW_DIR_NAME echo "/" | cat $INPUT - > $NEW_DIR_NAME/mac.temp.temp.temp # isn't that cute :-) perl $SUPPORT_FILES_DIR/prnumich $NEW_DIR_NAME/mac.temp.temp.temp > $NEW_DIR_NAME/umich.files cd $NEW_DIR_NAME rm mac.temp.temp.temp echo "bye" | cat umich.files - > mac.temp.temp.temp rm umich.files mv mac.temp.temp.temp umich.files sh $SUPPORT_FILES_DIR/getumich rm mac.archive.umich.edu.* # comment out to save log transcript files rm umich.files # comment out to save parsed ftp input file #rm ../$INPUT # comment out to save original input file exit endif exit SHAR_EOF chmod +x 'getit' fi if test -f 'getumich' then echo shar: "will not over-write existing file 'getumich'" else cat << \SHAR_EOF > 'getumich' #!/bin/sh host=mac.archive.umich.edu in=umich.files out=$host.results err=$host.errs # How long to sleep between subsequent tries (in seconds): #time=5 # Downright Nasty :-( time=59 # One minute #time=559 # Ten minutes #time=3559 # An hour #time=7159 # Two hours echo "Starting to get files from $host." > $out echo "Trying to reach $host at time:" >> $out date +'%H:%M hrs; %d %h %y' >> $out ftp $host < $in >> $out 2> $err while test -s $err do echo "Cannot connect now, will try again in $time seconds." >> $out sleep $time echo "Trying to reach $host at time:" >> $out date +'%H:%M hrs; %d %h %y' >> $out ftp $host < $in >> $out 2> $err done echo "File transfer successful!" >> $out echo "File transfer completed at:" >> $out date +'%H:%M hrs; %d %h %y' >> $out SHAR_EOF chmod +x 'getumich' fi if test -f 'prnumich' then echo shar: "will not over-write existing file 'prnumich'" else cat << \SHAR_EOF > 'prnumich' #!/usr/bin/perl $= = 999999; $first = 1; while (<>) { chop; if (m=^/=) { # pathname -- starts new entry if (!$first) { $arr{$pathname} = $comment; } $pathname = $_; $first = 0; undef($comment); } elsif (/^\s*$/) { # blank line next; # skip it } elsif (/^\s*\d+\s+\d+\/\d+\/\d+\s+[\w\d]+/) { # Infoline next; # skip it } else { m/^\s*(\S.*)\s*$/; # take only good stuff $comment = "$comment $1"; # append to comment } } @keys = keys(%arr); @keys = sort(@keys); foreach $key (@keys) { $key =~ m=^(/.+/)([\w\.]+)\s*$=; # find line components $path = $1; $filename = $2; $comment = $arr{$key}; $comment =~ s/^\s*//; write; # print line components } format STDOUT_TOP = ascii . format STDOUT = cd ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~ $path get ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~ $filename . # end of perl script SHAR_EOF chmod +x 'prnumich' fi if test -f 'sample-input' then echo shar: "will not over-write existing file 'sample-input'" else cat << \SHAR_EOF > 'sample-input' For those mail server users (I've been watching the logs while archiving), I want to emphasize again that it's a good idea to use the "chunk " command, where is the number of Kbytes your mailer can safely handle. Using the chunk command will speed your & other folks' requests, and you won't have so many parts to catenate together in the end. If there's anything I can do to make using the archives easier, please feel free to drop me e-mail... I can be reached at "mike@mac.archive.umich.edu" for many more months to come.' mike@mac.archive.umich.edu -------------------------- /mac/00help/newthings.txt 124 7/13/93 Text A compilation of all the recent files at mac.archive.umich.edu 35 7/13/93 Text Very thorough chart on the ENTIRE Mac line, including all the new systems. This includes a list of configurations, list of system versions, manufacture and prices, and a list Speedometer tests. Version 7/8/93. 40 7/13/93 BinHex4.0,Compact1.33 Changes your signature in Eudora. You can drag and drop a text file onto Autograph and it'll change your Eudora signature to that. If you tell it to make a TEXT file into a signature, the next time you double-click on the file, the signature in Eudora will be changed to it. 86 7/13/93 BinHex4.0,StuffIt3.06 A calculator and much more. Evaluate algebraic expressions with variables, recursive functions and even plot functions. 110 7/13/93 BinHex4.0 Expand files compressed with Now Compress. 262 7/13/93 BinHex4.0,StuffIt3.06 The KA9Q Amateur Radio Internet Protocol package. Provides internet services (telnet, smtp, ftp, tcp/ip, udp, macip, slfp) for connections over serial lines. 48 7/13/93 BinHex4.0,StuffIt3.06 Displays The Aurora Borealis. Can control your Latitude. 192 7/14/93 BinHex4.0,Compact1.33 Edit the levels of MacSokoban 2.0, or create your own levels. The files are saved as TEXT files or you can export it directly into MacSokoban. Requires Hypercard 2.0 & at least a 13" monitor. SHAR_EOF fi exit 0 # End of shell archive .