#!/bin/sh function ts2date(){ date -d"@$1" +%U } rrdtool fetch nodes.rrd -s -24w LAST | while read line; do echo $line ts=$(sed -e "s/\([0-9]*\):.*/\1/" $line) ts2date $ts done