#!/bin/sh # # # Author: Bernhard Kuehl # Universitaet Osnabrueck # Mon Jun 23 12:34:36 MET DST 1997 # File: xntpdiff # Description: # PATH=/usr/local/gnu/bin:/usr/bin:/bin:.:/usr/local/bin export PATH usage () { echo `basename $0` '[applied|lehre|praxis]' 1>&2 exit 1 } fatal () { echo ${1+"$@"} >&2 exit 1 } { [ $# != 1 ] && usage #for i in isolde artemis tristan merlin bobby min artos portos for i in `getHosts "$1"` do echo processing $i >&2 echo processing $i xntpdc -p $i 2>&1 echo '=======================================================================' done } | sed 's/[ ][ ]*/:/g' | gawk -F':' ' BEGIN { max=0 maxHost="" } /^processing/ { host=$2 next } $2=="remote" { getline # ============ weglesen while(getline>0) { if( $0 ~ /^========/) next offset=$7 if(offset*offset > max*max) { max=offset maxHost=host } } } END { if(maxHost != "") print maxHost,"hat einen Abstand von", max,"Sekunden" } ' exit 0