From e3eb490ed74fc917a3b7230d243f7936a2db2221 Mon Sep 17 00:00:00 2001 From: "Slawomir Wojciech Wojtczak (vermaden)" Date: Wed, 15 Aug 2012 01:47:54 +0200 Subject: [PATCH] Speed up the BEADM LIST -S. --- beadm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/beadm b/beadm index 9af3c05..d8bb3e0 100755 --- a/beadm +++ b/beadm @@ -150,6 +150,11 @@ case ${1} in WIDTH_NAME=$(( ${WIDTH_NAME} - ${#BENAME_STARTS_WITH} - 1 )) printf "%-${WIDTH_NAME}s %-6s %-10s %6s %6s %s\n" \ BE Active Mountpoint Space Policy Created + if [ "${2}" = "-S" ] + then + # do the detailed space calculation [-S] + USED_ALL=$( zfs list -H -t all -o name,used ) + fi echo "${LIST}" \ | while read NAME USED MOUNTPOINT Y m d H M do @@ -174,8 +179,6 @@ case ${1} in esac if [ "${2}" = "-S" ] then - # do the detailed space calculation [-S] - USED_ALL=$( zfs list -H -t all -o name,used ) while read I do USED=$( echo "${USED_ALL}" | grep -m 1 "^${I}" | awk '{print $2}' )