(change version, small bug fix)

fixed small issue, discovered that etch bash/ps does not support the + operator for --sort, only -, eg: +rss fails and -rss works.
This commit is contained in:
inxi-svn 2010-02-14 03:44:10 +00:00
parent d43a83d93d
commit 211cba3a5f

12
inxi
View file

@ -1,8 +1,8 @@
#!/bin/bash
########################################################################
#### Script Name: inxi
#### version: 1.4.1
#### Date: February 12 2010
#### version: 1.4.2
#### Date: February 13 2010
########################################################################
#### SPECIAL THANKS
########################################################################
@ -3198,7 +3198,7 @@ get_partition_data_advanced()
eval $LOGFE
}
# args: $1 - type +vsz/%cpu
# args: $1 - type -rss/%cpu Note: +rss not supported on older systems, like Etch
get_ps_data()
{
eval $LOGFS
@ -3245,6 +3245,9 @@ get_ps_data()
}
' ) )
# make the array ordered highest to lowest so output looks the way we expect it to
# this isn't necessary for -rss, and we can't make %cpu ordered the other way, so
# need to reverse it here. -rss is used because on older systems +rss is not supported
if [[ $1 == '%cpu' ]];then
array_length=${#A_PS_DATA[@]};
while (( $i < $array_length/2 ))
do
@ -3253,6 +3256,7 @@ get_ps_data()
A_PS_DATA[$array_length-$i-1]=$reorder_temp
(( i++ ))
done
fi
IFS="$ORIGINAL_IFS"
@ -4787,7 +4791,7 @@ print_ps_data()
b_print_first='false'
fi
if [[ $B_SHOW_PS_MEM_DATA == 'true' ]];then
get_ps_data '+rss'
get_ps_data '-rss'
print_ps_item 'mem' "$b_print_first"
fi