How to stop the Prstat using shell script ?
because after i run the below script the thing seems to be always in loop and cannot get out till i ctrl + c, is there anything that i can add in the script to make it terminate ?
<code>
#!/bin/sh
prstat -Tc -u testing > testing.txt
</code>
please help a noob ....
this prints one page
you can adapt more options to your needs
Hi,
I am writing a bash shell script. How can I tell it to stop. For example, I would like to have something similar to the following:
mike=1
if ; then
STOP THE SCRIPT
fi (3 Replies)
Hello,
I am ftping the file from one unix box to another box. This script works fine. Only problem here is, it is asking the password when ftp the file. How can i stop that. I am providing the password inside the shell script. But it is not accepting this. I need to put this script in crontab.... (5 Replies)
Script_A.sh has
echo "In am in script A"
ksh ## K-shell is invoked.
Script B.sh ## which I am writing...
./script_A.sh
echo "I am in script B"
return 0
When I run:
$> Script_B.sh
$> I am in script A
$>
Basically, on calling Script_A.sh from within Script_B.sh I have the issue of... (2 Replies)
Hi All,
I would like to develop a shell script for stop & start an application server (1-4) on Solaris box. Here are the user requirements for this task.
1. User will input the option which server they wish to stop.
2. Will clear cache files from specific location.
3. ... (1 Reply)
Hi guys, I've found two nifty little scripts on these forums one which detects if the F5 key has been pressed:
#/bin/sh
_key()
{
local kp
ESC=$'\e'
_KEY=
read -d '' -sn1 _KEY
case $_KEY in
"$ESC")
while read -d '' -sn1 -t1 kp
do
_KEY=$_KEY$kp
... (0 Replies)
I have a strange problem.
I have the following in a cron to find files older than a day.
find /dir1/dir2/ ! -name . -prune -name "s*.txt" -type f -mtime +1 -exec echo {} \; | wc -w
It was working fine for the last few days now it suddenly stopped working. I can clearly see files in the... (5 Replies)
Need shell script to:
1/keep polling a directory "receive_dir" irrespective of having files or no files in it.
2/move the files over to another directory "send_dir".
3/the script should only stop polling upon a file "stopfile" get moved to "receive_dir". Thanks !!
My script:
until
do... (0 Replies)
Hi folks,
I am running a shell script it asks for username and password to stop some service, I need to write some script that it will read username and password from my shell script and then sucessfully stop services without prompting username/password query. (13 Replies)
Hi,
I need to create a shell script for automated server patching, with the following scenario:
I have two Linux servers Primary and secondary.
Server patching should start on Primary 1st and then secondary.
1st check both servers are up and running.
Then stop primary and patching will... (1 Reply)
I am writing a bash shell script for GarazLab's "WP EMAIL CRAWLER - AUTO SCRAPER & REAL TIME EXTRACTOR". it contains some commands. I want to stop the shell execution as soon as it encounters an error. how to do it? (8 Replies)
Discussion started by: tahsin352
8 Replies
LEARN ABOUT OSX
topsysproc
topsysproc(1m) USER COMMANDS topsysproc(1m)NAME
topsysproc - top syscalls by process name. Uses DTrace.
SYNOPSIS
topsysproc [-Cs] [interval [count]]
DESCRIPTION
This program continually prints a report of the number of system calls by process name, and refreshes the display every 1 second or as
specified at the command line. Similar data can be fetched with "prstat -m".
Since this uses DTrace, only users with root privileges can run this command.
OPTIONS -C don't clear the screen
-s print per second values
EXAMPLES
Default output, 1 second updates,
# topsysproc
Print every 5 seconds,
# topsysproc 5
Print a scrolling output,
# topsysproc -C
FIELDS
load avg
load averages, see uptime(1)
syscalls
total syscalls in this interval
syscalls/s
syscalls per second
PROCESS
process name
COUNT total syscalls in this interval
COUNT/s
syscalls per second
NOTES
There may be several PIDs with the same process name.
DOCUMENTATION
See the DTraceToolkit for further documentation under the Docs directory. The DTraceToolkit docs may include full worked examples with ver-
bose descriptions explaining the output.
EXIT
topsysproc will run until Ctrl-C is hit.
AUTHOR
Brendan Gregg [Sydney, Australia]
SEE ALSO dtrace(1M), prstat(1M)version 0.90 Jun 13, 2005 topsysproc(1m)