#!/bin/bash # data from postime.c if ! test -s postime.tmp; then echo 'run postime first!' fi gnuplot << EOF | set term table plot 'postime.tmp' smooth sbezier with dots EOF tail +3 | sed 's/ [iou]$//' | awk ' BEGIN{ printf("/* AUTOMATICALLY GENERATED. DO NOT EDIT. */\n"); printf("/* distance in sectors, time in microseconds */\n\n"); printf("static const struct postime { int dist, time; } postime_data[] = {\n") } ($1||$2){ printf("\t{ %d, %d },\n", $1, $2) } END{ printf("};\n") }' > postime_data.h