From fafa928807d4d6ffb514bc47a9173b6a757a473c Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Fri, 7 Jul 2017 11:01:40 +0100 Subject: [PATCH] check-bkp-status.in: Force `sqlite3' output options to be correct. If the user has a `.sqlite3' file which overrides the default output options (quite likely, because the default format is rather ugly) then `check-bkp-status' gets very confused. So add a bunch of options: * `-batch' suppresses the annoying `Loading resources from HOME/.sqliterc' banner; * `-list' forces thing-separated items rather than tabulated output; * `-separator |' sets the thing which separates items; and * `-noheader' suppresses the column headings. Honestly there ought to be a `-norc' option, but there isn't. --- check-bkp-status.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check-bkp-status.in b/check-bkp-status.in index d45c06b..75ddf60 100644 --- a/check-bkp-status.in +++ b/check-bkp-status.in @@ -407,7 +407,7 @@ backup () { case $host:$fs in $p) matchp=t; break ;; esac done case $matchp in nil) return ;; esac - when=$(sqlite3 $INDEXDB \ + when=$(sqlite3 -batch -list -separator \| -noheader $INDEXDB \ "SELECT MAX(date) FROM idx WHERE host = '$host' AND fs = '$fs';") case $when in "") -- 2.11.0