From fe066bf62f6a2c545a94d8e4a6c68ca00f3b6a18 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Sun, 14 Feb 2010 03:49:54 +0000 Subject: [PATCH] bug fix, have to reverse sort orders too, sigh... --- inxi | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/inxi b/inxi index e7a4110..a72e02f 100755 --- a/inxi +++ b/inxi @@ -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=""