LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Run program from prompt repeatly. (https://www.linuxquestions.org/questions/linux-newbie-8/run-program-from-prompt-repeatly-636134/)

UltraSoul 04-17-2008 10:12 PM

Run program from prompt repeatly.
 
Sometimes, I want to see excetuable program result from prompt repeatly.
Eg: # cat /proc/interrupts; sleep 1; cat /proc/interrupts

But I just can see one cycle by the command above.
I wonder if I can use sopme commands to run command repeatly.

anomie 04-17-2008 10:18 PM

See the manpages for watch(1).

pixellany 04-17-2008 10:23 PM

That command does exactly what it says----ie it runs "cat", then "sleep", then "cat" again.

You need a loop--e.g.:
while true; do cat nums; sleep 1; done

In this example, "nums" is the name of a file on my machine.

I suggest going to tldp.org and getting the Bash Guide for Beginners, by Machtelt Garrels


All times are GMT -5. The time now is 04:07 PM.