cleanup output and dump files
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 17 Feb 2020 19:44:15 +0000 (20:44 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 17 Feb 2020 19:44:15 +0000 (20:44 +0100)
gnt-smart-query.sh
smart-query.sh

index 285717e..92bfb91 100755 (executable)
@@ -2,4 +2,4 @@
 
 cp smart-query.sh /tmp/smart-query.sh
 gnt-cluster copyfile /tmp/smart-query.sh
-gnt-cluster command -M /tmp/smart-query.sh $* | grep -v '^return'
+gnt-cluster command -M /tmp/smart-query.sh $* | grep -v '^return' | grep -v '^--*$' | tee /dev/shm/gnt-smart-query | column -t -s :
index 5ba086a..92a126c 100755 (executable)
@@ -5,7 +5,7 @@ test -e /tmp/s.last && rm /tmp/s.last
 for col in "Device Model" "User Capacity" $*
 do
        # sed and sort is required for join later
-       grep "$col" /dev/shm/smart.sd* | sed 's/:/: /' | sed \
+       grep "$col" /dev/shm/smart.sd? | sed \
                -e "s/$col: */ : /" \
                -e "s/[0-9]* $col .* \([0-9][0-9]*\)$/ : \1/" \
        | sort > /tmp/s.this
@@ -18,4 +18,4 @@ do
        fi
 done
 
-cat /tmp/s.last | sed 's!/dev/shm/smart.!!' | column -t -s :
+cat /tmp/s.last | sed -e 's!/dev/shm/smart.!!' -e 's/: : / : /'