From e414d8e14bf45054318e5fb32e26152716373fdb Mon Sep 17 00:00:00 2001 From: Jeremy Kaplan Date: Mon, 10 Sep 2018 09:39:23 -0700 Subject: [PATCH] shellcheck some scripts --- bin/passget | 12 +++++++----- bin/reminder | 2 +- dunst/ding | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/bin/passget b/bin/passget index e2c6ea3..747d46c 100755 --- a/bin/passget +++ b/bin/passget @@ -1,13 +1,15 @@ -#!/bin/sh +#!/bin/bash -if [[ -z "$1" ]]; then +if [ -z "$1" ]; then echo 'Nothing to get' exit 1 fi -contents=$(gopass show $1) || exit 1 +set -euo pipefail + +contents=$(gopass show "$1") || exit 1 echo "$contents" | grep '^user:' | cut -d' ' -f2 | xsel -b echo 'Username clipped' -read +read -r _ -gopass show --clip $1 +gopass show --clip "$1" diff --git a/bin/reminder b/bin/reminder index e93dbc5..eb75000 100755 --- a/bin/reminder +++ b/bin/reminder @@ -4,7 +4,7 @@ set -euo pipefail timespec="$1" message="$2" -cmd="notify-send '$1' '$2'" +cmd="notify-send '${message}'" echo "$cmd" | at -M "$timespec" atq diff --git a/dunst/ding b/dunst/ding index 2b5b6e9..4af29f8 100755 --- a/dunst/ding +++ b/dunst/ding @@ -1,3 +1,3 @@ #!/usr/bin/env bash -aplay $(dirname "$0")/ding.wav +aplay "$(dirname "$0")/ding.wav"