From c63f7e9f64ee394b3311edb7f36f56fd786d145a Mon Sep 17 00:00:00 2001 From: a1346054 Date: Tue, 31 Aug 2021 17:01:47 +0000 Subject: shell scripts: fix shellcheck warnings --- contrib/gocryptfs-maybe.bash | 2 +- contrib/maxlen.bash | 8 ++++---- contrib/mount-ext4-ramdisk.sh | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'contrib') diff --git a/contrib/gocryptfs-maybe.bash b/contrib/gocryptfs-maybe.bash index 78a6b2c..daf3e60 100755 --- a/contrib/gocryptfs-maybe.bash +++ b/contrib/gocryptfs-maybe.bash @@ -12,7 +12,7 @@ # Note that pam_mount ignores messages on stdout which is why printing # to stdout is ok. set -eu -MYNAME=$(basename $0) +MYNAME=$(basename "$0") if [[ $# -lt 2 || $1 == -* ]]; then echo "Usage: $MYNAME CIPHERDIR MOUNTPOINT [-o COMMA-SEPARATED-OPTIONS]" >&2 exit 1 diff --git a/contrib/maxlen.bash b/contrib/maxlen.bash index 99ffb1f..be5f7a6 100755 --- a/contrib/maxlen.bash +++ b/contrib/maxlen.bash @@ -32,8 +32,8 @@ while true ; do echo "error: file $PWD/$NEXT already exists" exit 1 fi - echo -n 2> /dev/null > $NEXT || break - rm $NEXT + echo -n 2> /dev/null > "$NEXT" || break + rm "$NEXT" NAME="$NEXT" done echo "${#NAME}" @@ -47,8 +47,8 @@ if [[ $QUICK -ne 1 ]]; then NAME="" while true ; do NEXT="${NAME}x" - mkdir $NEXT 2> /dev/null || break - rmdir $NEXT + mkdir "$NEXT" 2> /dev/null || break + rmdir "$NEXT" NAME="$NEXT" done MAX_DIRNAME=${#NAME} diff --git a/contrib/mount-ext4-ramdisk.sh b/contrib/mount-ext4-ramdisk.sh index 5ff7ef1..79f18a2 100755 --- a/contrib/mount-ext4-ramdisk.sh +++ b/contrib/mount-ext4-ramdisk.sh @@ -2,7 +2,7 @@ MNT=/mnt/ext4-ramdisk -if mountpoint $MNT ; then +if mountpoint "$MNT" ; then exit 1 fi -- cgit v1.2.3