X-Git-Url: https://iankelling.org/git/?p=iankelling.org;a=blobdiff_plain;f=get-comments;h=54ea99a6a28e504ecb27e8b6bfc94316e96bd5be;hp=36bbe0dfca800540ea439a254da9a0ca044544ca;hb=e02cd51eb9c9ac3f84a84fefd567d7217e34bc38;hpb=daefd301f9bdc0df7b7f4d77ca249291e9388d9b diff --git a/get-comments b/get-comments index 36bbe0d..54ea99a 100755 --- a/get-comments +++ b/get-comments @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -l # Copyright (C) 2016 Ian Kelling # This program is free software: you can redistribute it and/or modify @@ -20,7 +20,7 @@ trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR cd "${BASH_SOURCE%/*}/proposed-comments" all=false -shell="ssh iankelling.org" +shell="ssh $(chost iankelling.org)" while [[ $1 ]]; do case $1 in -a) all=true; shift ;; @@ -41,9 +41,9 @@ EOF fi # we may want to avoid rate limited posts here too. -sql="select * from c" +sql="select * from c;" if [[ $date ]]; then - date_clause=" where date > cast('$date' as real)" + sql+=" where date > cast('$date' as real)" fi -echo "$sql" -$s "$sql" > /tmp/hcomments +echo "executing: $sql" +$s > /tmp/hcomments <<<"$sql"