-#!/bin/bash
+#!/bin/bash -l
# Copyright (C) 2016 Ian Kelling
# This program is free software: you can redistribute it and/or modify
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 ;;
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"