mirror of
https://github.com/smxi/inxi.git
synced 2024-11-16 16:21:39 +00:00
Added support for file system names with 2 or fewer spaces in partition info, fringe cases, but 1.0.0 should be handling most fringe cases
decently well by now.
This commit is contained in:
parent
9d4a80ba02
commit
ea48c34edb
8
inxi
8
inxi
|
@ -2335,9 +2335,17 @@ get_partition_data()
|
|||
$NF !~ /^\/$|^\/boot$|^\/var$|^\/home$|^\/tmp$|^\/usr$|^filesystem/ {
|
||||
# this is to avoid file systems with spaces in their names, that will make
|
||||
# the test show the wrong data in each of the fields, if no x%, then do not use
|
||||
# using 3 cases, first default, standard, 2nd, 3rd, handles one and two spaces in name
|
||||
if ( $(NF - 1) ~ /[0-9]+\%/ ) {
|
||||
print $NF "," $(NF - 4) "," $(NF - 3) "," $(NF - 1) ",secondary"
|
||||
}
|
||||
# these two cases construct the space containing name
|
||||
else if ( $(NF - 2) ~ /[0-9]+\%/ ) {
|
||||
print $(NF - 1) " " $NF "," $(NF - 5) "," $(NF - 4) "," $(NF - 2) ",secondary"
|
||||
}
|
||||
else if ( $(NF - 3) ~ /[0-9]+\%/ ) {
|
||||
print $(NF - 2) " " $(NF - 1) " " $NF "," $(NF - 6) "," $(NF - 5) "," $(NF - 3) ",secondary"
|
||||
}
|
||||
}
|
||||
' )
|
||||
# now add the swap partition data, doesn't show percent used, someone can figure that in the future
|
||||
|
|
Loading…
Reference in a new issue