#! /bin/csh unalias rm if ($#argv != 2) then echo ' ' echo 'Usage: collect maps all ' echo ' ' echo ' collects the mapping information from M/Map.aug for all' echo ' maps M listed in the file maps and puts the sorted output ' echo ' into the file all. The name of each map is either the' echo ' contents of the file M/Name if it exists, or M, if not.' echo ' ' echo ' Output format: ' echo ' ' echo ' s g g1 s1 Cod Name' echo ' ' echo ' means that map named Name sends g in Dom_s to g1 in Cod_s1' echo ' (Here Dom is the directory in which all this takes place.)' echo ' ' echo ' If the map is a cocycle dual to a generator g0 this means ' echo ' g0 * g1 is the sum of all such g.' echo ' ' exit endif set maps=$argv[1] set all=$argv[2] if (-e $all) then echo 'Output file' $all 'already exists. Move or remove it first.' exit endif set suff=$$ while (-e ${all}_$suff) set suff=`expr 1 + $suff` end set tempall=${all}_$suff touch $tempall foreach m (`cat $maps`) if (-e $m/Name) then set name=`cat $m/Name` else set name=$m endif set hdr=`head -1 $m/Def` set s0=$hdr[1] set cod=$hdr[4] awk '{s1=$1-S; printf("%3d %4d (%3d %4d %6s) %s\n",$1,$2,s1,$3,C,N);}' S=$s0 C=$cod N=$name <$m/Map.aug >>$tempall end sort -k1.1,1.3n -k1.6,1.8n -k1.12,1.14n -k1.17,1.19n <$tempall | awk -f ../map_template/spacit.awk >$all rm $tempall exit