Any command to watch output repeatedly??


 
Thread Tools Search this Thread
Operating Systems Solaris Any command to watch output repeatedly??
# 1  
Old 02-21-2008
Any command to watch output repeatedly??

Hi Experts,,

Can you tell me "Is there any command in solaris that gives the output repeatedly for every x seconds" when used with other commands like ls,du,df,etc..Like prstat updates its output for every 5 seconds..

If i want to view how much of disk usage is going on a filesystem for every x seconds..when i am installing a software/package ...what i need to do..Is there any command in solaris which satisfies this requirement...or should we need to write some script to satisfy this...

My search doen't resulted much about that..but i found that there is a command called "watch" in linux which completely satisfies this requirement...

How to use the watch command, by The Linux Information Project (LINFO)

Want everyone to share their knowledge to get a solution to this...
# 2  
Old 02-21-2008
Not really sure for solaris, but you always can have simple script like...

while true;do
command
sleep 5
done

This will display command output every 5s until u break it...
# 3  
Old 02-21-2008
"yes" repeatedly outputs the result of command
Quote:
yes "<command>; sleep 5" | sh
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Check if a file type exists repeatedly

Hi, I have the below script that checks if the .tar file exists in my present directory. If so, extract it and then delete it except if the .tar filename is blent.tar #!/bin/bash while ; do echo "TAR BALL EXISTS" for f in *.tar; do echo "File -> $f" tar -xvf $f rm -ir $f... (7 Replies)
Discussion started by: mohtashims
7 Replies

2. Shell Programming and Scripting

Using the watch command

so i have a very long script which i have to run. when i run this script, i want to monitor the the openssl commands it runs. the way ive attempted to do this is: watch -t -n 1 "(date '+TIME:%H:%M:%S' ; ps aux | egrep openssl | egrep -v grep)" 2>&1 | tee -a logfile the above command is... (2 Replies)
Discussion started by: SkySmart
2 Replies

3. Shell Programming and Scripting

Insert title as output of command to appended file if no output from command

I am using UNIX to create a script on our system. I have setup my commands to append their output to an outage file. However, some of the commands return no output and so I would like something to take their place. What I need The following command is placed at the prompt: TICLI... (4 Replies)
Discussion started by: jbrass
4 Replies

4. Shell Programming and Scripting

Replace a string with each line from another file repeatedly

I don't know if it's been asked before but seems i gave up seeking. i have 2 files : file1.txt Monday XXXX Tuesday XXXX XXXX Wednesday Thursday XXXX XXXX is in every lines of file1.txt and i want to replace them with each line in file2.txt: home school cinema so output file is: ... (19 Replies)
Discussion started by: perseous
19 Replies

5. Shell Programming and Scripting

Use script to monitor command output question? (like Linux watch)

Hi I want to write a script, help me to monitor command output. This script like Linux "watch" command. Below is my script: # cat watch.sh #!/bin/bash while true do clear echo "command: $*" ( $* ) sleep 2 done Then I run this script below (2 Replies)
Discussion started by: nnnnnnine
2 Replies

6. HP-UX

looking for a unix command for hpux - watch

watch is a common linux command that executes a program periodically, showing output fullscreen. I couldn't find anything for hpux, so I created the following shell which the user is testing: cat /usr/bin/watch #!/bin/sh while ; do clear echo "Command: $*" date echo "" ... (2 Replies)
Discussion started by: mr_manny
2 Replies

7. UNIX for Dummies Questions & Answers

watch command

Hi, Please help me out! In the man pages they dont talk about any options that can be used to terminate a running 'watch' command. Do you know a way of terminating the command using an option? Thanks (1 Reply)
Discussion started by: foxtron
1 Replies

8. Shell Programming and Scripting

Command similar to watch

Hi all, I am trying to create a file that shows the CPU usage, constantly updating (similar to TOP). So far i have a file (called test) containing: echo "The current CPU usage is:" `ps -e -o pcpu|awk 'NR > 0 { s +=$1 }; END {print s"%"}'` and then I ran the command: watch -d 0.5 -t... (3 Replies)
Discussion started by: mikejreading
3 Replies

9. UNIX for Dummies Questions & Answers

Command display output on console and simultaneously save the command and its output

Hi folks, Please advise which command/command line shall I run; 1) to display the command and its output on console 2) simultaneous to save the command and its output on a file I tried tee command as follows; $ ps aux | grep mysql | tee /path/to/output.txt It displayed the... (7 Replies)
Discussion started by: satimis
7 Replies

10. UNIX for Dummies Questions & Answers

Linux watch command on AIX?

On Linux I could use the `watch` command to loop a command X times. Is there a similar command on AIX? If not, is there a way to write a loop on the command line to do this? Linux: watch -d -n 60 'db2 list applications show detail | grep Connect | wc -l' AIX: ??? (2 Replies)
Discussion started by: djschmitt
2 Replies
Login or Register to Ask a Question