]> sourceware.org Git - lvm2.git/commitdiff
tests: aux.sh using grep -c
authorZdenek Kabelac <zkabelac@redhat.com>
Thu, 29 Jun 2017 05:59:11 +0000 (07:59 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Thu, 29 Jun 2017 20:23:17 +0000 (22:23 +0200)
Consider using grep -c instead of grep|wc -l.

test/lib/aux.sh

index a3e2b7015f0f949f124492288c3e56386607dbef..b13056055c5e59c597e0a2ea3b7973804c3863a6 100644 (file)
@@ -423,7 +423,7 @@ teardown_devs_prefixed() {
        if test -f REMOVE_FAILED; then
                local num_devs
                local num_remaining_devs=999
-               while num_devs=$(dm_table | grep "$prefix" | wc -l) && \
+               while num_devs=$(dm_table | grep -c "$prefix") && \
                    test "$num_devs" -lt "$num_remaining_devs" -a "$num_devs" -ne 0; do
                        test "$stray" -eq 0 || echo "Removing $num_devs stray mapped devices with names beginning with $prefix: "
                        # HACK: sort also by minors - so we try to close 'possibly later' created device first
This page took 0.032034 seconds and 5 git commands to generate.