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
This commit is contained in:
inxi-svn 2008-11-02 20:46:25 +00:00
parent a197f7dd0b
commit 51754db4ba

13
inxi
View file

@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### version: 0.3.3 #### version: 0.3.4
#### Date: November 1 2008 #### Date: November 2 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
#### As time permits functionality and recoding will occur. #### As time permits functionality and recoding will occur.
@ -1230,11 +1230,11 @@ get_networking_data()
for (i in eth) { for (i in eth) {
if (eth[i]>1) { if (eth[i]>1) {
a[j]=eth[i]"x "i 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 { else {
a[j]=i 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++ j++
} }
@ -1391,7 +1391,8 @@ print_gfx_data()
print_hard_disk_data() print_hard_disk_data()
{ {
local hdd_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 root_home_data=$( echo $root_home_data ) # get rid of linebreaks
if [ "$VERBOSITY_LEVEL" -ge 3 ];then if [ "$VERBOSITY_LEVEL" -ge 3 ];then
@ -1402,7 +1403,7 @@ print_hard_disk_data()
print_screen_output "$hdd_data" print_screen_output "$hdd_data"
if [ "$VERBOSITY_LEVEL" -ge 4 ];then 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" print_screen_output "$hdd_data"
fi fi
} }