commit fe1749b4aaef4802a784b4821a04875df68b9e54 Author: audy Date: Thu Jun 29 07:07:57 2023 -0600 init diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..a6e1d33 --- /dev/null +++ b/README.txt @@ -0,0 +1,24 @@ +simple tool to repeat a shell command automatically + +detailed behavior: + clear the screen, execute [command], wait 0.1 seconds, repeat. exit immediatly on strong break. + +usage: + repeat [command] + + note: if the [command] has spaces in it (for example - passing parameters to the program), remember to surround it with quotes +example: + repeat date + repeat the date command, so you will have a terminal with the date at the top left + repeat "ls -l" + repeatedly list all of the files in the working directory, to see if a new one appears, or the access time changes + repeat ./repeat + uh oh + + + +todo: + define behavior for repeat without options + take command line input for time to wait before repeating + clean exit + style this page like a man page (im not gonna make it an actual man page though, because this is just a few lines of c in one executable) diff --git a/repeat b/repeat new file mode 100755 index 0000000..b8a3360 Binary files /dev/null and b/repeat differ diff --git a/repeat.c b/repeat.c new file mode 100644 index 0000000..9427c1e --- /dev/null +++ b/repeat.c @@ -0,0 +1,11 @@ +#include +#include + +int main(int argc, char *argv[]) { + while(1) { + system("clear"); + system(argv[1]); + usleep(100000); //0.1 second + } + exit(0); +} diff --git a/repeat.o b/repeat.o new file mode 100644 index 0000000..ed39dd0 Binary files /dev/null and b/repeat.o differ