From 271d75558a4272c6d2cf56ac020de990d5852863 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Mon, 22 Aug 2016 21:49:59 +0100 Subject: [PATCH] bin/dbq detect pipe stdout --- bin/dbq | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/dbq b/bin/dbq index eed01438..6985d097 100755 --- 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'})) { -- 2.47.3