From: Nicolas Boisselier Date: Mon, 22 Aug 2016 20:49:59 +0000 (+0100) Subject: bin/dbq detect pipe stdout X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=271d75558a4272c6d2cf56ac020de990d5852863;p=nb.git bin/dbq detect pipe stdout --- 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'})) {