Search Results

Search: Posts Made By: NarayanaPrakash
2,757
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...
5,083
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,611
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,757
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,757
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,757
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 ----------...
1,840
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...
1,847
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

 

Featured Tech Videos

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