From: Alexander Barton Date: Sat, 6 Aug 2016 17:28:13 +0000 (+0200) Subject: Fix some shellcheck(1) warnings X-Git-Url: https://arthur.barton.de/gitweb/?p=ax-unix.git;a=commitdiff_plain;h=49e6b8be175bbc1857d269f50c95f341a63c2383;ds=sidebyside Fix some shellcheck(1) warnings --- diff --git a/bup/save-user/bup-save-user b/bup/save-user/bup-save-user index 608a2ed..c60f06a 100755 --- a/bup/save-user/bup-save-user +++ b/bup/save-user/bup-save-user @@ -25,7 +25,7 @@ if [ ! -d "$HOME/.bup" ]; then 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" diff --git a/lib/ax/ax-common.sh b/lib/ax/ax-common.sh index fbeb579..b50cab6 100644 --- a/lib/ax/ax-common.sh +++ b/lib/ax/ax-common.sh @@ -1,3 +1,4 @@ +#!/bin/sh # # 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. # +# shellcheck disable=SC2034 ax_common_sourced=1 # Display a colored message. @@ -23,9 +25,7 @@ ax_msg1() { *) 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 "${*}"