head 1.5; access; symbols; locks; strict; comment @# @; 1.5 date 95.06.09.21.13.03; author p-pomes; state Exp; branches; next 1.4; 1.4 date 95.06.09.21.10.02; author p-pomes; state Exp; branches; next 1.3; 1.3 date 95.05.31.17.26.12; author p-pomes; state Exp; branches; next 1.2; 1.2 date 95.05.28.00.02.48; author p-pomes; state Exp; branches; next 1.1; 1.1 date 95.05.27.23.47.20; author p-pomes; state Exp; branches; next ; desc @@ 1.5 log @*** empty log message *** @ text @#!%PerlProg% # # n.oarlet - generate a sorted list of addresses for registration letters # # Usage: n.oarlet [-d] [letfile] # # -d print debugging and trace information. # letfile input file of assigned network id, password, address, etc. # # Copyright (c) 1995 University of Illinois Board of Trustees and Paul Pomes # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. All advertising materials mentioning features or use of this software # must display the following acknowledgement: # This product includes software developed by the University of # Illinois at Urbana, and their contributors. # 4. Neither the name of the University nor the names of their # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE TRUSTEES AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE TRUSTEES OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # @@(#)$Id: n.oarlet,v 1.4 1995/06/09 21:10:02 p-pomes Exp p-pomes $ %ColCode = ( "6", "VCR", "7", "Gen", "8", "PAffairs", "9", "VCSA", "10", "Health", "12", "AHR", "15", "Agric", "17", "CBA", "20", "Educ", "22", "Eng", "24", "FAA", "26", "Grad", "28", "Comm", "30", "Law", "32", "LAS", "34", "Nurse", "36", "ALS", "40", "Extramural", "43", "Med", "44", "VetMed", "50", "Army", "52", "Avi", "60", "Labor", "61", "Beckman", "65", "Environ", "68", "Social", "72", "Summer", "73", "ContEd", "74", "LIS", "79", "IPS", "80", "Lib", "82", "OandM", "83", "FSI", "85", "Rec", "86", "Relig", "91", "Athl" ); require 'open2.pl'; # Written to the sundry sort pipes is # nameaddressnetidpasswordcitizenshipnew_status # coll_enr_categorycollege # # Students are initially split into two groups. The first group has a # new status of 1 or college enrollment category of 5 or 6. The other # group is the remainder. Each of the two groups is then sorted by # citizenship, then college, then last name. The sort results are # concatenated together and the letter file produced. $Icmd = "/usr/bin/sort -t \"\t\" -k8,8n -k6,6n -k1,1"; $Dcmd = "/usr/bin/sort -t \"\t\" -k8,8n -k1,1"; $IALLR = 'IALLR'; $IALLW = 'IALLW'; $Ipid = &open2($IALLR, $IALLW, $Icmd); die "Can't D1 open2($Dcmd): $!\n" if ($Ipid == 0); $DONER = 'DONER'; $DONEW = 'DONEW'; $DIpid = &open2($DONER, $DONEW, $Dcmd); die "Can't D1 open2($Dcmd): $!\n" if ($DIpid == 0); $DTWOR = 'DTWOR'; $DTWOW = 'DTWOW'; $DIIpid = &open2($DTWOR, $DTWOW, $Dcmd); die "Can't D2 open2($Dcmd): $!\n" if ($DIIpid == 0); # # here we go... while (<>) { chop; $line = $_; ($name,$addr,$netid,$password,$cit,$new_status,$cec,$college) = split(/\t/); if ($college == 40) { print STDERR "$netid\t$name\tEXTRAMURAL\n"; } elsif ($cit eq "f") { print $IALLW "$line\n"; } elsif ($new_status == 1 || $cec == 5 || $cec == 6) { print $DONEW "$line\n"; } elsif ($new_status > 1) { print $DTWOW "$line\n"; } else { print STDERR "$netid\t$name\tUNUSED\n"; } } close($IALLW); close($DONEW); close($DTWOW); while ($line = <$IALLR>) { chop ($line); ($name,$addr,$netid,$password,$cit,$new_status,$cec,$college) = split(/\t/, $line); $addr =~ s/\\n/\n /g; print "1$name\n $addr\n $ColCode{$college} $new_status intl\n2$netid\n3$password\n"; } while ($line = <$DONER>) { chop ($line); ($name,$addr,$netid,$password,$cit,$new_status,$cec,$college) = split(/\t/, $line); $addr =~ s/\\n/\n /g; print "1$name\n $addr\n $ColCode{$college} $new_status dom\n2$netid\n3$password\n"; } while ($line = <$DTWOR>) { chop ($line); ($name,$addr,$netid,$password,$cit,$new_status,$cec,$college) = split(/\t/, $line); $addr =~ s/\\n/\n /g; print "1$name\n $addr\n $ColCode{$college} $new_status dom\n2$netid\n3$password\n"; } @ 1.4 log @*** empty log message *** @ text @d41 1 a41 1 # @@(#)$Id: n.oarlet,v 1.3 1995/05/31 17:26:12 p-pomes Exp p-pomes $ d117 4 a120 1 if ($cit eq "f") { a127 3 } elseif ($college == 40) { print STDERR "$netid\t$name\tEXTRAMURAL\n"; @ 1.3 log @revised sort criteria @ text @d41 1 a41 1 # @@(#)$Id: n.oarlet,v 1.2 1995/05/28 00:02:48 p-pomes Exp p-pomes $ a42 28 # Layout is: Len Col #ssn 9 1 #current-full-name 40 10 #previous-ssn 9 50 #permanent-addr-line1 30 59 #permanent-addr-line2 30 89 #permanent-addr-street 30 119 #permanent-addr-city 15 149 #permanent-addr-state 2 164 #permanent-addr-zip 9 166 #campus-addr-line1 30 175 #campus-addr-line2 30 205 #campus-addr-street 30 235 #campus-addr-city 15 265 #campus-addr-state 2 280 #campus-addr-zip 9 282 #last-auth-date 8 291 #network-id 8 299 #new_status 1 307 #class_code 1 308 #coll-enr-category 1 309 #college 2 310 #curriculum 4 312 #hs-name 30 316 #ferpa 20 346 #citizenship 1 366 #auth_src 1 367 d61 1 d93 1 a93 1 $Icmd = "/usr/bin/sort -t \"\t\" -k6,6n -k7,7n -k8,8n -k1,1"; d125 3 @ 1.2 log @update comments. @ text @d41 1 a41 1 # @@(#)$Id: n.rewrite,v 1.6 1995/05/27 20:59:28 p-pomes Exp p-pomes $ d120 2 a121 1 $Cmd = "/usr/bin/sort -t \"\t\" -k5,5 -k8,8n -k1,1"; d123 11 a133 7 $ONER = 'ONER'; $ONEW = 'ONEW'; $Ipid = &open2($ONER, $ONEW, $Cmd); die "Can't 1 open2($Cmd): $!\n" if ($Ipid == 0); $TWOR = 'TWOR'; $TWOW = 'TWOW'; $IIpid = &open2($TWOR, $TWOW, $Cmd); die "Can't 2 open2($Cmd): $!\n" if ($IIpid == 0); d144 2 a145 2 if ($new_status == 1 || $cec == 5 || $cec == 6) { print $ONEW "$line\n"; d147 3 d151 1 a151 1 print $TWOW "$line\n"; d157 3 a159 2 close($ONEW); close($TWOW); d161 7 a167 4 %CitCode = ( "d", "dom", "f", "intl" ); d169 1 a169 1 while ($line = <$ONER>) { d174 1 a174 1 print "1$name\n $addr\n $ColCode{$college}1$CitCode{$cit}\n2$netid\n3$password\n"; d177 1 a177 1 while ($line = <$TWOR>) { d182 1 a182 1 print "1$name\n $addr\n $ColCode{$college}2$CitCode{$cit}\n2$netid\n3$password\n"; @ 1.1 log @Initial revision @ text @a0 1 #!/usr/bin/perl d5 6 a10 3 # Copyright (c) 1985 Corporation for Research and Educational Networking # Copyright (c) 1988 University of Illinois Board of Trustees, Steven # Dorner, and Paul Pomes d23 1 a23 2 # This product includes software developed by the Corporation for # Research and Educational Networking (CREN), the University of d25 1 a25 1 # 4. Neither the name of CREN, the University nor the names of their d41 1 a41 1 # @@(#)$Id: s.unblock,v 1.2 1995/01/11 00:07:47 p-pomes Exp $ @