Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-17-2008, 10:12 PM   #1
Registered: Dec 2004
Location: Japan
Distribution: REDHAT9.0, Mandrake10.1
Posts: 404

Rep: Reputation: 31
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.
Old 04-17-2008, 10:18 PM   #2
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
See the manpages for watch(1).
Old 04-17-2008, 10:23 PM   #3
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
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 and getting the Bash Guide for Beginners, by Machtelt Garrels


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
alsa ubuntu dapper ich5 crashes repeatly oss too cjae Linux - Newbie 1 01-15-2007 09:15 AM
run program as root / password prompt acidjuice Linux - Software 6 03-15-2005 10:33 PM
program executions thru prompt kev^ Linux - General 4 03-14-2004 11:59 AM
typing a program name in the command prompt to run it iammeuno Linux - Newbie 1 12-19-2003 01:11 PM
Change prompt values from within a C++ program pshea Linux - Newbie 0 09-16-2003 11:06 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:52 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration