Search Results

Search: Posts Made By: NarayanaPrakash
3,123
Posted By Just Ice
you are trying to run an interactive script...
you are trying to run an interactive script non-interactively ...
echo " if you want to record the cpu utilization for specific time period press y else press enter "
read ip
you need to make the...
6,272
Posted By MadeInGermany
topas is specific to AIX. A general attempt is...
topas is specific to AIX.
A general attempt is to feed a delayed quit command from the shell over a pipe
(sleep 3; echo q) | topas
3,999
Posted By codemaniac
try using printf. :) prstat 1 1 | awk...
try using printf. :)

prstat 1 1 | awk '{printf ("%10s %10s %10s %10s\n",$1,$2,$9,$10)}'
2,998
Posted By Skrynesaver
It will, but you will have to parse and aggregate...
It will, but you will have to parse and aggregate the resulting data, however why not

top -b -d $seconds -n2 | egrep '^Cpu' | tail -1


Which will give you the cpu usage line.

alternatively:...
2,998
Posted By Skrynesaver
GNU top takes a -n flag which is the...
GNU top takes

a -n flag which is the number of iterations to run
a -d flag, which is the delay between iterations
and a -b flag which streams output suitable for processing


So you could...
2,998
Posted By vidyadhar85
redirect the output of your top command to a file...
redirect the output of your top command to a file and start that as background process run sleep for 5 mins and then kill the background process.

---------- Post updated at 02:19 PM ----------...
2,120
Posted By rbatte1
Well, you could run it once and read the...
Well, you could run it once and read the responses. Try something like this and see if it gets you nearer to what you are after:-if [ "$#" == "0" ]
then
echo " Please mention the server name...
2,531
Posted By Corona688
I see the problem. Outside a function, $1 $2...
I see the problem.

Outside a function, $1 $2 ... mean commandline parameters.

Inside a function, $1 $2 ... mean function parameters.

my_function $1
Showing results 1 to 8 of 8

 
All times are GMT -4. The time now is 12:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy