From 3dadd268e3add88226a00fb5e34403051768350d Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Sun, 2 Nov 2008 20:57:56 +0000 Subject: [PATCH] Fixed color in awk, using ENVIRON method --- inxi | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/inxi b/inxi index 6cb4e06..03e6db7 100755 --- a/inxi +++ b/inxi @@ -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