From 60a615c989fa6d1880113061da2429ed58122a1c Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Tue, 22 Mar 2016 23:33:06 +0000 Subject: [PATCH] dbq option cut, LESS nor more break eof --- bin/dbq | 8 +++++++- etc/profile.d/envs | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/dbq b/bin/dbq index f19079ed..2e42c61e 100755 --- a/bin/dbq +++ b/bin/dbq @@ -155,7 +155,12 @@ $keys{table} = $1 if $keys{db} and $keys{db} =~ s/:(.*)$//; # # Parser # -if ($keys{format} eq 'nc') { +if ( $Opt{cut} ) { + open(STDOUT,"|cut -f $Opt{cut}"); + $keys{format} = 'csv'; + $keys{header} = '0'; + +} elsif ($keys{format} eq 'nc') { $keys{format} = 'csv'; open(STDOUT,"|$0 --parse_debug|$0 --csv2txt ".( ( defined($keys{header}) ? $keys{header} : '') eq '0' ? '1' : '0')) @@ -428,6 +433,7 @@ Curl / Php query wrapper =head1 OPTIONS + option[cut=s] Parse output to cut, imply format=csv and header=0 option[ssh=s] SERVER Run the script on that server option[verbose|v+] Verbose mode: increase the verbosity level. option[debug+] Debug mode: increase the verbosity level. diff --git a/etc/profile.d/envs b/etc/profile.d/envs index 7f02f85c..f2513931 100644 --- a/etc/profile.d/envs +++ b/etc/profile.d/envs @@ -41,7 +41,7 @@ export PATH export IGNOREEOF=0 export LESS="-iMR" -export PAGER="less -iMRE" +export PAGER="less $LESS" export EDITOR=vim case "$OSTYPE" in darwin*) export DARWIN=1;; esac -- 2.47.3