Created
November 19, 2010 20:10
-
-
Save mdippery/707075 to your computer and use it in GitHub Desktop.
For those times when you type `fail -t` instead of `tail -f`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <unistd.h> | |
int main(int argc, char **argv) | |
{ | |
int i; | |
fprintf(stderr, | |
" FAIL WHALE! \n" | |
"W W W \n" | |
" W W W \n" | |
" '. W \n" | |
" .-\"\"-._ \\ \\.--|\n" | |
" / \"-..__) .-' \n" | |
"| _ / \n" | |
"\\'-.__, .__.,' \n" | |
" `'____'. \\--' \n" | |
"VVVVVVVVVVVVVVVVVVVVV\n"); | |
fprintf(stderr, "It's entirely possible you meant to type `tail`, so let's try that.\n"); | |
/* Sometimes you're a dumbass and type `fail -t` when you mean | |
`tail -f`, so correct '-t' (which isn't a legit tail option | |
anyway) to '-f'. */ | |
for (i = 1; i < argc; i++) { | |
if (strcmp(argv[i], "-t") == 0) { | |
argv[i] = "-f"; | |
} | |
} | |
return execvp("tail", argv); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment