bug fix, have to reverse sort orders too, sigh...

This commit is contained in:
inxi-svn 2010-02-14 03:49:54 +00:00
parent 211cba3a5f
commit fe066bf62f

15
inxi
View file

@ -3202,7 +3202,18 @@ get_partition_data_advanced()
get_ps_data()
{
eval $LOGFS
local array_length='' reorder_temp='' i=0
local array_length='' reorder_temp='' i=0 head_tail=''
# bummer, have to make it more complex here because of reverse sort
# orders in output, pesky lack of support of +rss in old systems
case $1 in
-rss)
head_tail='head'
;;
%cpu)
head_tail='tail'
;;
esac
# throttle potential irc abuse
if [[ $B_RUNNING_IN_SHELL != 'true' && $PS_COUNT -gt 5 ]];then
@ -3210,7 +3221,7 @@ get_ps_data()
fi
IFS=$'\n'
# note that inxi can use a lot of cpu, and can actually show up here as the script runs
A_PS_DATA=( $( ps aux --sort $1 | grep -v 'inxi' | tail -n $PS_COUNT | gawk '
A_PS_DATA=( $( ps aux --sort $1 | grep -Ev "($SCRIPT_NAME|%CPU)" | $head_tail -n $PS_COUNT | gawk '
BEGIN {
IGNORECASE=1
appName=""