#include int main(int argc, char **argv) { double t, dt; long n; if (argc != 4) { fprintf(stderr, "ERROR: wrong argument count\nUse %s total_time time_per_trace \"trace command(s) \"\n", argv[0]); return -1; } if ((sscanf(argv[1], "%lf", &t) != 1) || (sscanf(argv[2], "%lf", &dt) != 1)) { fprintf(stderr, "failed to read arg 1/2\n"); return -1; } printf("%f, %f\n", t, dt); // print the full command once // now print enough newline (= command repetitions) // TODO: be faster than lame-duck-speed n = (long) (t / dt); // on step already passed because of above printf statement while (n>1) { printf("\n"); n--; } }