Index: tools/repeat.c
===================================================================
--- tools/repeat.c	(revision 5eba8ce7d2f2f63af75e5135e3e78ac690ab4d1b)
+++ tools/repeat.c	(revision 967e3c949f6b5f8e726cfdcde5bf5144feffb9ad)
@@ -51,4 +51,6 @@
 	fprintf(out, "\t-i\t\toutput iterations instead of CMD stdout\n");
 	fprintf(out, "\t-x\t\tprint CMD before running it\n");
+	fprintf(out, "\t-a FILE\t\tredirect output of command to append to FILE\n");
+	fprintf(out, "\t-r FILE\t\tredirect output of command to FILE\n");
 	exit(code);
 }
@@ -56,4 +58,7 @@
 char ** cmd_to_run = NULL;
 bool print_cmd = false;
+bool redirect = false;
+bool redirect_append = false;
+char * redirect_to = "/dev/null";
 pid_t child_pid = 0;
 
@@ -74,5 +79,5 @@
 
 	int c;
-	while ( (c = getopt_long( argc, argv, "hsxi", long_opts, &long_index)) != -1 ) {
+	while ( (c = getopt_long( argc, argv, "ahirsx", long_opts, &long_index)) != -1 ) {
 		switch ( c ) {
 			case Help:
@@ -88,4 +93,16 @@
 			case 'i':
 				print_iterations = true;
+				break;
+			case 'a':
+				if(redirect) { fprintf(stderr, "Cannot have -a and -r\n"); error(); }
+				redirect_append = true;
+				redirect_to = argv[optind];
+				optind++;
+				break;
+			case 'r':
+				if(redirect_append) { fprintf(stderr, "Cannot have -a and -r\n"); error(); }
+				redirect = true;
+				redirect_to = argv[optind];
+				optind++;
 				break;
 			default:
@@ -143,7 +160,7 @@
 			printf("\n");
 		}
-		if(print_iterations) {
+		if(print_iterations || redirect || redirect_append) {
 			__attribute__((unused)) FILE * ignore =
-				freopen("/dev/null", "w", stdout);
+				freopen(redirect_to, redirect_append ? "a" : "w" , stdout);
 		}
 		execvp ( *cmd_to_run, cmd_to_run);
