mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
(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:
parent
d43a83d93d
commit
211cba3a5f
28
inxi
28
inxi
|
@ -1,8 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
########################################################################
|
########################################################################
|
||||||
#### Script Name: inxi
|
#### Script Name: inxi
|
||||||
#### version: 1.4.1
|
#### version: 1.4.2
|
||||||
#### Date: February 12 2010
|
#### Date: February 13 2010
|
||||||
########################################################################
|
########################################################################
|
||||||
#### SPECIAL THANKS
|
#### SPECIAL THANKS
|
||||||
########################################################################
|
########################################################################
|
||||||
|
@ -3198,7 +3198,7 @@ get_partition_data_advanced()
|
||||||
eval $LOGFE
|
eval $LOGFE
|
||||||
}
|
}
|
||||||
|
|
||||||
# args: $1 - type +vsz/%cpu
|
# args: $1 - type -rss/%cpu Note: +rss not supported on older systems, like Etch
|
||||||
get_ps_data()
|
get_ps_data()
|
||||||
{
|
{
|
||||||
eval $LOGFS
|
eval $LOGFS
|
||||||
|
@ -3245,14 +3245,18 @@ get_ps_data()
|
||||||
}
|
}
|
||||||
' ) )
|
' ) )
|
||||||
# make the array ordered highest to lowest so output looks the way we expect it to
|
# make the array ordered highest to lowest so output looks the way we expect it to
|
||||||
array_length=${#A_PS_DATA[@]};
|
# this isn't necessary for -rss, and we can't make %cpu ordered the other way, so
|
||||||
while (( $i < $array_length/2 ))
|
# need to reverse it here. -rss is used because on older systems +rss is not supported
|
||||||
do
|
if [[ $1 == '%cpu' ]];then
|
||||||
reorder_temp=${A_PS_DATA[i]}
|
array_length=${#A_PS_DATA[@]};
|
||||||
A_PS_DATA[i]=${A_PS_DATA[$array_length-$i-1]}
|
while (( $i < $array_length/2 ))
|
||||||
A_PS_DATA[$array_length-$i-1]=$reorder_temp
|
do
|
||||||
(( i++ ))
|
reorder_temp=${A_PS_DATA[i]}
|
||||||
done
|
A_PS_DATA[i]=${A_PS_DATA[$array_length-$i-1]}
|
||||||
|
A_PS_DATA[$array_length-$i-1]=$reorder_temp
|
||||||
|
(( i++ ))
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
IFS="$ORIGINAL_IFS"
|
IFS="$ORIGINAL_IFS"
|
||||||
|
|
||||||
|
@ -4787,7 +4791,7 @@ print_ps_data()
|
||||||
b_print_first='false'
|
b_print_first='false'
|
||||||
fi
|
fi
|
||||||
if [[ $B_SHOW_PS_MEM_DATA == 'true' ]];then
|
if [[ $B_SHOW_PS_MEM_DATA == 'true' ]];then
|
||||||
get_ps_data '+rss'
|
get_ps_data '-rss'
|
||||||
print_ps_item 'mem' "$b_print_first"
|
print_ps_item 'mem' "$b_print_first"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue