]> arthur.barton.de Git - ax-unix.git/commitdiff
Fix some shellcheck(1) warnings
authorAlexander Barton <alex@barton.de>
Sat, 6 Aug 2016 17:28:13 +0000 (19:28 +0200)
committerAlexander Barton <alex@barton.de>
Sat, 6 Aug 2016 17:28:13 +0000 (19:28 +0200)
bup/save-user/bup-save-user
lib/ax/ax-common.sh

index 608a2ed27ba94014b2e161367263676eb03b0568..c60f06a410e8175929eb084ee1740ca12c4a5aed 100755 (executable)
@@ -25,7 +25,7 @@ if [ ! -d "$HOME/.bup" ]; then
 fi
 
 paths="$HOME"
 fi
 
 paths="$HOME"
-[ -n "$LOCAL_HOME" -a "$LOCAL_HOME" != "$HOME" -a -d "$LOCAL_HOME" ] \
+[ -n "$LOCAL_HOME" ] && [ "$LOCAL_HOME" != "$HOME" ] && [ -d "$LOCAL_HOME" ] \
        && paths="$paths $LOCAL_HOME"
 [ -d "/var/spool/mail/$LOGNAME" ] \
        && paths="$paths /var/spool/mail/$LOGNAME"
        && paths="$paths $LOCAL_HOME"
 [ -d "/var/spool/mail/$LOGNAME" ] \
        && paths="$paths /var/spool/mail/$LOGNAME"
index fbeb5793c05df9f8ab7706b32f2a570c85cd6f60..b50cab6f23081f875ee2df2e9277f95d364d27e7 100644 (file)
@@ -1,3 +1,4 @@
+#!/bin/sh
 #
 # ax-common.sh -- Common Functions for Shell Scripts
 # Copyright (c)2013-2015 Alexander Barton (alex@barton.de)
 #
 # ax-common.sh -- Common Functions for Shell Scripts
 # Copyright (c)2013-2015 Alexander Barton (alex@barton.de)
@@ -8,6 +9,7 @@
 # (at your option) any later version.
 #
 
 # (at your option) any later version.
 #
 
+# shellcheck disable=SC2034
 ax_common_sourced=1
 
 # Display a colored message.
 ax_common_sourced=1
 
 # Display a colored message.
@@ -23,9 +25,7 @@ ax_msg1() {
                *)      c="0";
        esac
        # print colored word(s):
                *)      c="0";
        esac
        # print colored word(s):
-       printf "\033[0;${c}m"
-       /bin/echo -n "${1}"
-       printf "\033[0m "
+       printf "\033[0;%sm%s\033[0m " "${c}" "${1}"
        shift
        # print remaining word(s) and trailing newline:
        echo "${*}"
        shift
        # print remaining word(s) and trailing newline:
        echo "${*}"