logo

utils

~/.local/bin tools and git-hooks
commit: 3d3bc624f853d5f1d6feb6c7109b5523c77b54bf
parent: 6dc013c60bfa73be20a7520e1e32186e9e170594
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Wed, 23 Aug 2017 23:39:31 +0200

bin/{memsys,timey-whyme}.sh: Fix problems found by ShellCheck

Diffstat:

Mbin/memsys.sh2+-
Mbin/timey-whyme.sh16+++++++---------
2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/bin/memsys.sh b/bin/memsys.sh @@ -1,4 +1,4 @@ #!/bin/sh locker='slock' -su -c "su -c $locker $(id -u -nr) & echo mem > /sys/power/state" $(id -u -nr 0) +su -c "su -c $locker $(id -u -nr) & echo mem > /sys/power/state" "$(id -u -nr 0)" diff --git a/bin/timey-whyme.sh b/bin/timey-whyme.sh @@ -1,19 +1,17 @@ #!/bin/sh # Copyright CC-BY-SA-4.0 2017- Haelwenn (lanodan) Monnier <contact@hacktivis.me> -xdd="${XDG_DATA_DIR:-$HOME/.local/share}/timey-whyme" -today=$(date --date=${2:-now} +%Y-%m-%d) -later=$(date --date=${2:-+7days} +%Y-%m-%d) -heading='\t%s\n' -highlight='%s' -form='column -s, -o  -t' + xdd="${XDG_DATA_DIR:-$HOME/.local/share}/timey-whyme" +today="$(date --date=now +%Y-%m-%d)" +later="$(date --date=+7days +%Y-%m-%d)" + form='column -s, -o  -t' usage() { printf "Usage: [[all|both|cal|todo]\n" } verify_xxd() { - [ -e ${xdd}/$1 ] || echo "Please create a file a the following, see examples for help: ${xdd}/${1}" + [ -e "${xdd}/${1}" ] || echo "Please create a file a the following, see examples for help: ${xdd}/${1}" } todo() { @@ -21,7 +19,7 @@ todo() { echo ",0,###, To Do, ### ${today},###, Now +7 days, ### ${later},###, Later,### -$(grep -v '^#' $xdd/todo.csv)" | sort -n | $form +$(grep -av '^#' "$xdd/todo.csv")" | sort -n | $form } calendar() { @@ -29,7 +27,7 @@ calendar() { echo "0000-00-00,###, Calendar, ### ${today},###, Now +7 days, ### ${later},###, Later,### -$(grep -v '^#' $xdd/calendar.csv)" | sort -n | $form +$(grep -av '^#' "$xdd/calendar.csv")" | sort -n | $form } case "$1" in