From 85af69fc0f7941bea940cb8e98e4ee869c4f11f1 Mon Sep 17 00:00:00 2001 From: Klemens Nanni Date: Sat, 16 Apr 2016 04:00:35 +0200 Subject: [PATCH 7/7] query.sh: Quote properly, use ${var} not $var --- query.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/query.sh b/query.sh index 9e2337d..72657b3 100755 --- a/query.sh +++ b/query.sh @@ -5,24 +5,24 @@ # Purpose: locate new queries for the ii irc client # ---------------------------------------------------- -IRCPATH=$HOME/irc -TMPFILE=$IRCPATH/queries.tmp +IRCPATH="${HOME}"/irc +TMPFILE="${IRCPATH}"/queries.tmp -[ -f $TMPFILE ] || touch $TMPFILE +[ -f "${TMPFILE}" ] || touch "${TMPFILE}" echo "searching new query data" -for i in $(find $IRCPATH -newer $TMPFILE -name 'out') +for i in $(find "${IRCPATH}" -newer $TMPFILE -name out) do # if file doesnt just contain server stuff grep -q -v '\-!\-' $i if [ $? -ne 1 ]; then # strip server, nickserv and channel out files - echo "$i" | grep -q -v -i -E "nickserv|#|$IRCPATH/(irc\.freenode\.net|irc\.oftc\.net)/out" + echo "${i}" | grep -q -v -i -E "nickserv|#|${IRCPATH}/(irc\.freenode\.net|irc\.oftc\.net)/out" if [ $? -ne 1 ]; then - printf "new data in: %s\n========================================================\n" "$i" - tail -n5 $i + printf "new data in: %s\n========================================================\n" "${i}" + tail -n5 "${i}" fi fi done -touch $TMPFILE +touch "${TMPFILE}" -- 2.8.0