]> git.nbdom.net Git - nb.git/commitdiff
dbq use env
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Wed, 16 Mar 2016 10:54:29 +0000 (11:54 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Wed, 16 Mar 2016 10:54:29 +0000 (11:54 +0100)
bin/dbq

diff --git a/bin/dbq b/bin/dbq
index 23e79bd57cae18e6527316687728dd2f96f4b08d..ebfddc2748dbc785a0a0bb44c6a58d781dc08730 100755 (executable)
--- a/bin/dbq
+++ b/bin/dbq
@@ -3,6 +3,7 @@ use strict;
 use warnings;
 use Encode;
 use URI::Escape;
+use File::Spec;
 use NB::Functions qw/html2txt/;
 use NB qw/$ROOT_DIR/;
 #################################################################################
@@ -99,7 +100,9 @@ $url =~ s,^(\w+://)?([^@]+)@(.*?)$,$1$3, and push(@EXEC,"db=$2");
 $url =~ m@^ssh://(.*)$@ and $Opt{ssh} = $1;
 #die "$url | ",join(' ',@EXEC);
 
-exec('ssh',$Opt{ssh},$NAME,map{s/"/\\"/g;'"'.$_.'"'} @EXEC) if $Opt{ssh};
+exec('ssh',$Opt{ssh},'/usr/bin/env',"PATH=$ENV{PATH}","PERL5LIB=$ENV{PERL5LIB}",$NAME,map{s/"/\\"/g;'"'.$_.'"'} @EXEC) if $Opt{ssh};
+#exec('ssh',$Opt{ssh},$NAME,map{s/"/\\"/g;'"'.$_.'"'} @EXEC) if $Opt{ssh};
+#exec('ssh',$Opt{ssh},File::Spec->rel2abs($0),map{s/"/\\"/g;'"'.$_.'"'} @EXEC) if $Opt{ssh};
 
 #
 # Add options to ARGV