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 :
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
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/: : / : /'