LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 04-17-2008, 11:12 PM   #1
UltraSoul
Member
 
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, 11:18 PM   #2
anomie
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, 11:23 PM   #3
pixellany
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 tldp.org and getting the Bash Guide for Beginners, by Machtelt Garrels
 
  


Reply


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 10:15 AM
run program as root / password prompt acidjuice Linux - Software 6 03-15-2005 11:33 PM
program executions thru prompt kev^ Linux - General 4 03-14-2004 12:59 PM
typing a program name in the command prompt to run it iammeuno Linux - Newbie 1 12-19-2003 02:11 PM
Change prompt values from within a C++ program pshea Linux - Newbie 0 09-17-2003 12:06 AM


All times are GMT -5. The time now is 10:17 AM.

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