bug fix for nested {}... in cpu section

This commit is contained in:
inxi-svn 2008-10-29 08:18:56 +00:00
parent fce18b8fa4
commit 07605806d7

7
inxi
View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### version: 0.1.32 #### version: 0.1.33
#### Date: October 28 2008 #### Date: October 28 2008
######################################################################## ########################################################################
#### inxi is a fork of infobash, the original bash sys info script by locsmif #### inxi is a fork of infobash, the original bash sys info script by locsmif
@ -692,7 +692,7 @@ get_distro_data()
get_cpu_data() get_cpu_data()
{ {
local i='' j='' local i='' j='' cpu_array_nu=''
OSKERN=$( uname -a | gawk '{print $1,$3,$(NF-1)}' ) OSKERN=$( uname -a | gawk '{print $1,$3,$(NF-1)}' )
IFS=$'\n' IFS=$'\n'
@ -789,7 +789,8 @@ get_cpu_data()
IFS="$OIFS" IFS="$OIFS"
# For the short line # For the short line
CPUMODEL="${CPU2}${CPU2+ }${CPUTMP[0]}" # clocked at [${CPU[${#CPU[@]}-1]}]" # old CPU2 CPUMODEL="${CPU2}${CPU2+ }${CPUTMP[0]}" # clocked at [${CPU[${#CPU[@]}-1]}]" # old CPU2
CPUCLOCK="$CPU[${#CPU[@]}-1]" # old CPU3 cpu_array_nu=$(( ${#CPU[@]} - 1 ))
CPUCLOCK="${CPU[$cpu_array_nu]}" # old CPU3
CPUFLAGS="${CPUTMP[3]}" # old CPU4 CPUFLAGS="${CPUTMP[3]}" # old CPU4
# nx = AMD stack protection extensions # nx = AMD stack protection extensions
# lm = Intel 64bit extensions # lm = Intel 64bit extensions