Please help me on how to store topas -P command result in a variable for 1 iteration in AIX server

Hi Team,

Please help me on how to store topas -P command result in a variable for 1 iteration in AIX server

The result of a command is stored in a variable (then printed) like this:

varname=$( command )
echo "$varname"

The $( )is named "command substitution".

I don't find a count/iteration limit in
man topas

Hi,

Thank you for the reply. topas -P command resulting a window and continuously refreshing. Unable to comeout. In linux we have top -b that will work in non interactive mode. Kindly guide me silimar command in AIX if any

I am a fan of ps.
Even in Linux I'd prefer

ps -eo pid,user,pri,ni,vsz,rss,state,pcpu,%mem,args

over

top -n 1 -b

Thank a lot for the recommendation. I will check and work on this.
Thank you again :slight_smile:

Please guide me how to sort multiple columns in Linux for below
ps -eo pid,user,pri,ni,vsz,rss,state,pcpu,%mem,args

I have given an example in your other thread.
The ps output is piped into a command group (that might turn into a sub shell), where the first line (header) is printed and the other lines are sorted (and the output is printed).
The general Unix commands like ps,sort,grep,bash work on AIX and Linux (while GNU/Linux commands have further options).
Always consult the man pages for the available options:
man ps
man sort
man grep
man bash
Ok, at the beginning they are hard to understand, so try them out on the command prompt.

1 Like

Sure. Thanks a lot for the guidelines. I will work on those to get more idea.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.