init
This commit is contained in:
commit
fe1749b4aa
24
README.txt
Normal file
24
README.txt
Normal file
@ -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)
|
||||||
11
repeat.c
Normal file
11
repeat.c
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
int main(int argc, char *argv[]) {
|
||||||
|
while(1) {
|
||||||
|
system("clear");
|
||||||
|
system(argv[1]);
|
||||||
|
usleep(100000); //0.1 second
|
||||||
|
}
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user