#!/bin/sh set -o noclobber old=$PWD cd $(dirname $(readlink -f "$0")) cd ../ FLUXPLUGHOME=$PWD . "$FLUXPLUGHOME"/master cd $old LINE=$("$APT" | "$AWK" -v myhost="$myhost" -v time=`date -u +%s%N` '{if ($1~/^Inst/) counter=counter+1} END {if (counter) printf "packages,host=%s packs=%si %s\n",myhost,counter,time}') if [ -n "${LINE##+([[:space:]])}" ]; then # <= FIXME! find a better way. writeline "$LINE" "$MAXLINES" fi