[lvm-devel] master - vgimportclone.sh: use well defined tests

Zdenek Kabelac zkabelac at sourceware.org
Thu Jun 29 20:27:21 UTC 2017


Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=ef4506069a1a29cd00532e36c24df9a01cd32600
Commit:        ef4506069a1a29cd00532e36c24df9a01cd32600
Parent:        8dc29d7cc7e86295116a4fb401315896b6793fa8
Author:        Zdenek Kabelac <zkabelac at redhat.com>
AuthorDate:    Wed Jun 28 20:35:34 2017 +0200
Committer:     Zdenek Kabelac <zkabelac at redhat.com>
CommitterDate: Thu Jun 29 22:23:16 2017 +0200

vgimportclone.sh: use well defined tests

Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
---
 scripts/vgimportclone.sh |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/scripts/vgimportclone.sh b/scripts/vgimportclone.sh
index ac52f01..7d3118f 100755
--- a/scripts/vgimportclone.sh
+++ b/scripts/vgimportclone.sh
@@ -95,8 +95,7 @@ function cleanup {
 SCRIPTNAME=$("$BASENAME" "$0")
 
 
-if [ "$UID" != "0" -a "$EUID" != "0" ]
-then
+if [ "$UID" != 0 ] && [ "$EUID" != 0 ]; then
     die 3 "${SCRIPTNAME} must be run as root."
 fi
 
@@ -183,14 +182,13 @@ do
 done
 
 # turn on DEBUG (special case associated with -v use)
-if [ -z "$DEBUG" -a $VERBOSE_COUNT -gt 3 ]; then
+if [ -z "$DEBUG" ] && [ "$VERBOSE_COUNT" -gt 3 ]; then
     DEBUG="-d"
     set -x
 fi
 
 # setup LVM_OPTS
-if [ -n "${DEBUG}" -o -n "${VERBOSE}" ]
-then
+if [ -n "$DEBUG" ] || [ -n "$VERBOSE" ]; then
     LVM_OPTS="${LVM_OPTS} ${DEBUG} ${VERBOSE}"
 fi
 




More information about the lvm-devel mailing list