[PATCH 2/8] dim: use [ p ] || [ q ] instead of test -a/-o

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fix shellcheck SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well
defined.

Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx>
---
 dim | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dim b/dim
index c36ebdc7f7d8..eb0f0df85338 100755
--- a/dim
+++ b/dim
@@ -160,7 +160,7 @@ done
 shift $((OPTIND - 1))
 
 # first positional argument is the subcommand
-if [ -n "$HELP" -o "$#" = "0" ]; then
+if [ -n "$HELP" ] || [ "$#" = "0" ]; then
     subcommand="usage"
 else
     subcommand="$1"
@@ -178,7 +178,7 @@ if [[ -n "$__dim_running" ]]; then
 fi
 export __dim_running=1
 
-if [ "$subcommand" != "setup" -a "$subcommand" != "help" -a "$subcommand" != "usage" ]; then
+if [ "$subcommand" != "setup" ] && [ "$subcommand" != "help" ] && [ "$subcommand" != "usage" ]; then
 	for d in $DIM_PREFIX $DIM_PREFIX/$DIM_DRM_INTEL $DIM_PREFIX/drm-rerere $DIM_PREFIX/drm-tip; do
 		if [ ! -d $d ]; then
 			echo "$d is missing, please check your configuration and/or run dim setup"
-- 
2.1.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux