#!/bin/sh # # # Author: Bernhard Kuehl # Universitaet Osnabrueck # Mon Jun 23 14:28:16 MET DST 1997 # File: checkArchive # Description: # PATH=/usr/local/gnu/bin:/usr/bin:/bin export PATH usage () { echo `basename $0` archivefile >&2 exit 1 } fatal () { echo ${1+"$@"} >&2 exit 1 } [ $# != 1 ] && usage exec gawk ' BEGIN { inFile=0 } /^-[r-][w-][xsS-][r-][w-][xsS-][r-][w-][xsStT-][ ]/ { inFile=1 if($1 ~ /[tTsS]/) { print "falscher Mode in Zeile",NR"." print "Kein s- or t-Bit erlaubt" exit 1 } if(NF>9) { print "Dateiname enthaelt Leerzeichen oder Tab in Zeile", NR exit 1 } name=$9 if(getline<=0) { print "illegal end of file" exit 1 } if($0 !~ /[0-9]+[ ]+[0-9]+[ ]+[0-9]+[ ]/) { print "wc-Zeile enthaelt zu wenig Zahlen" exit 1 } if($4 != name) { print "zwei unterschiedliche Dateinamen in Zeile", NR,"und", NR -1"." exit 1} lines=$1 for(i=0;i