#!/bin/bash

gcc mktimeconst.c || exit 1

X=1
while [ $X -lt 5000 ]
do
  echo $X

  perl ~/linux/linux/kernel/timeconst.pl $X | sed 's/KERNEL_TIMECONST/__KERNEL_TIMECONST/;/Automatically generated/d;/^$/d'> temp.txt
  ./a.out $X temp2.txt
  sed -i '/Automatically generated/d;/^$/d' temp2.txt

  diff -uw temp.txt temp2.txt || exit 1

  X=$(($X+1))
done
