From 51754db4ba5cece61ae061de6087a7d9743b3875 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Sun, 2 Nov 2008 20:46:25 +0000 Subject: [PATCH] Fine tuned hard disk partitions, put color values directly into the awk statement, that works fine if you use the correct ' and " sequences. Cleaned up repeated Partition and replaced with single Partition: and subsequent ID: for each detected one --- inxi | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/inxi b/inxi index a6f224f..6cb4e06 100755 --- a/inxi +++ b/inxi @@ -1,8 +1,8 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 0.3.3 -#### Date: November 1 2008 +#### version: 0.3.4 +#### Date: November 2 2008 ######################################################################## #### inxi is a fork of infobash, the original bash sys info script by locsmif #### As time permits functionality and recoding will occur. @@ -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]", at ports: "ports[i] + if (ports[i] != "") a[j]=a[j]" '"${C1}"'Port:'"${C2}"' "ports[i] } else { a[j]=i - if (ports[i] != "") a[j]=a[j]", at port: "ports[i]; + if (ports[i] != "") a[j]=a[j]" '"${C1}"'Port:'"${C2}"' "ports[i]; } j++ } @@ -1391,7 +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)$' | 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, ")"}' )" root_home_data=$( echo $root_home_data ) # get rid of linebreaks if [ "$VERBOSITY_LEVEL" -ge 3 ];then @@ -1402,7 +1403,7 @@ print_hard_disk_data() print_screen_output "$hdd_data" if [ "$VERBOSITY_LEVEL" -ge 4 ];then - hdd_data=$( create_print_line " " "${root_home_data}" ) + hdd_data=$( create_print_line " " "${C1}Partition:${C2} ${root_home_data}" ) print_screen_output "$hdd_data" fi }