Improve disk printing and layout

This commit is contained in:
Joshua Boniface 2019-06-17 13:13:37 -04:00
parent e3d0a4bf5d
commit 6c1d08fd1c
1 changed files with 3 additions and 3 deletions

View File

@ -34,10 +34,10 @@ done
disks="$(
for disk in /dev/sd?; do
gdisk_data="$( gdisk -l ${disk} 2>/dev/null )"
disk_data="$( fdisk -l ${disk} 2>/dev/null )"
echo -n "${disk}"
echo -n "\t$( grep "^Model:" <<<"${gdisk_data}" | awk '{ $1=""; print $0 }' )"
echo -n "\t$( grep "^Disk ${disk}:" <<<"${gdisk_data}" | awk '{ $1=$2=""; print $0 }' )"
echo -en "\t$( grep "^Disk model:" <<<"${disk_data}" | awk '{ $1=""; print $0 }' )"
echo -en " $( grep "^Disk ${disk}:" <<<"${disk_data}" | awk '{ $1=""; $2="size:"; print $0 }' )"
echo
done
)"