]> git.nbdom.net Git - nb.git/commitdiff
bin/dbq detect pipe stdout
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 22 Aug 2016 20:49:59 +0000 (21:49 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 22 Aug 2016 20:49:59 +0000 (21:49 +0100)
bin/dbq

diff --git a/bin/dbq b/bin/dbq
index eed0143894114cdfa900c01631a57cf08a63a504..6985d097ac039c5c849f8175a7432d932d57b420 100755 (executable)
--- a/bin/dbq
+++ b/bin/dbq
@@ -33,6 +33,8 @@ my %PARAM = (
 # NB 13.04.16   'db' => $ENV{$UC_NAME.'_DB'} ? $ENV{$UC_NAME.'_DB'} : '',
   'txt_errors' => $ENV{$UC_NAME.'_TXT_ERRORS'} ? $ENV{$UC_NAME.'_TXT_ERRORS'} : '1',
 );
+
+$PARAM{'format'} = 'text' unless -t  STDOUT;
 %PARAM = map {$_=>$PARAM{$_}} grep {$PARAM{$_} ne ''} keys %PARAM;
 if ($ENV{$UC_NAME.'_PARAMS'}) {
   for (split(' ',$ENV{$UC_NAME.'_PARAMS'})) {