![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| prstat output | senabhi | SUN Solaris | 5 | 05-14-2009 07:39 AM |
| prstat problem | vivsiv | Shell Programming and Scripting | 6 | 02-15-2008 07:58 PM |
| stop Prstat using shell script | filthymonk | Shell Programming and Scripting | 19 | 05-23-2007 05:24 AM |
| Mem analyze / vmstat, prstat ... | unclefab | SUN Solaris | 2 | 01-24-2007 02:58 PM |
| Help with prstat | vibhor_agarwali | UNIX for Dummies Questions & Answers | 6 | 04-07-2005 08:01 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Just type prstat on the command line and press enter.
If you get an error message saying something like "prstat: command not found" check your PATH environment variable to see if the directory in which prstat is located is included in the PATH echo $PATH Or, do you have a question about how to process the output of prstat in a specific way? |
|
||||
|
If you check the manual page for prstat you will see that besided a lot of options there are 2 optional arguments for prstat.
These arguments are: interval (interval in seconds between 2 statistics reports) count (Number of statistics reports) So you could use: prstat 2 5 Make 5 statistics reports with an interval of 2 seconds prtstat 3 Make endless statistics report with an interval of 3 seconds. prstat 0 1 Make 1 statistics report with an interval of 0 seconds (The interval is irrelevant here and can be any number, since it's only 1 report). To process the output of prstat in a scriipt you have to limit the number of statistics reports. Without this limitation prstat would never end and your script with never proceeed. You can redirect the limited number of statistics reports to some kind of file which you use later on in your script as source to extract/generate/manipulate or whatever. If you do not which to redirect the output to a file but like to process the outut right away, by piping the output to another command, it would be easiest to start with a single statistics report. Once you know how to parse that kind of information e.g. with (n)awk you count increase the number of statistics reports. But no matter what, make sure the number of statistics reports is limited, or your script will never end. There are ways to process a continious output stream of prstat, but shell scripting is not really suited for that. Basically you would have 2 programs and are dealing with IPC (Inter Process Communication). |
|
||||
|
Very good.
It works fine ! |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|