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?
IF you are at the command line, CTRL-C will stop the command - unless watch is called from inside a shell script with SIGINT trapped. (bash or ksh trap command)
If watch is a separate process,
where pid == process id of the process will terminate the process.
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)
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)
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)
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)
Hi there,
I was wondering if there was a way in UNIX that I could set up a running script that monitors a certain folder (and all the folders and files contained within it) so that if any file changes then it will be the change logged within a log file. I dont know if this is possible in Unix... (6 Replies)
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... (2 Replies)
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)