Fixed color in awk, using ENVIRON method

This commit is contained in:
inxi-svn 2008-11-02 20:57:56 +00:00
parent 51754db4ba
commit 3dadd268e3

12
inxi
View file

@ -1,7 +1,7 @@
#!/bin/bash
########################################################################
#### Script Name: inxi
#### version: 0.3.4
#### version: 0.3.6
#### Date: November 2 2008
########################################################################
#### inxi is a fork of infobash, the original bash sys info script by locsmif
@ -1210,7 +1210,7 @@ get_memory_data()
get_networking_data()
{
IFS=$'\n'
A_NETWORK_DATA=( $( echo "$lspci_data" | gawk '
A_NETWORK_DATA=( $( echo "$lspci_data" | C1=${C1} C2=${C2} gawk '
BEGIN { IGNORECASE=1 }
/^[0-9a-f:.]+ (ethernet|network) (controller|bridge)/ || /^[0-9a-f:.]+ [^:]+: .*(ethernet|network).*$/ {
nic=gensub(/^[0-9a-f:.]+ [^:]+: (.+)$/,"\\1","g",$0)
@ -1230,11 +1230,11 @@ get_networking_data()
for (i in eth) {
if (eth[i]>1) {
a[j]=eth[i]"x "i
if (ports[i] != "") a[j]=a[j]" '"${C1}"'Port:'"${C2}"' "ports[i]
if (ports[i] != "") a[j]=a[j] ENVIRON["C1"]" Port:"ENVIRON["C2"] ports[i]
}
else {
a[j]=i
if (ports[i] != "") a[j]=a[j]" '"${C1}"'Port:'"${C2}"' "ports[i];
if (ports[i] != "") a[j]=a[j] ENVIRON["C1"]" Port:"ENVIRON["C2"] ports[i];
}
j++
}
@ -1391,8 +1391,8 @@ print_gfx_data()
print_hard_disk_data()
{
local hdd_data=''
#local root_home_data="$( df -h -T | egrep '(/|/boot|/var|/home)$' | C1=${C1} C2=${C2} awk '{print ENVIRON["C1"]"Partition:"ENVIRON["C2"], $7, ENVIRON["C1"]"- ", ENVIRON["C1"]"size:"ENVIRON["C2"], $3, ENVIRON["C1"]"used:"ENVIRON["C2"], $4, "(", $6, ")"}' )"
local root_home_data="$( df -h -T | egrep '(/|/boot|/var|/home)$' | awk '{print "'"${C1}"'ID:'"${C2}"'", $7, "'"${C1}"'size:'"${C2}"'", $3, "'"${C1}"'used:'"${C2}"'", $4, "(", $6, ")"}' )"
local root_home_data="$( df -h -T | egrep '(/|/boot|/var|/home)$' | C1=${C1} C2=${C2} awk '{print ENVIRON["C1"]"ID:"ENVIRON["C2"], $7, ENVIRON["C1"]"size:"ENVIRON["C2"], $3, ENVIRON["C1"]"used:"ENVIRON["C2"], $4, "(", $6, ")"}' )"
#local root_home_data="$( df -h -T | egrep '(/|/boot|/var|/home)$' | awk '{print "'"${C1}"'ID:'"${C2}"'", $7, "'"${C1}"'size:'"${C2}"'", $3, "'"${C1}"'used:'"${C2}"'", $4, "(", $6, ")"}' )"
root_home_data=$( echo $root_home_data ) # get rid of linebreaks
if [ "$VERBOSITY_LEVEL" -ge 3 ];then