From: Nicolas Boisselier Date: Wed, 16 Mar 2016 10:54:29 +0000 (+0100) Subject: dbq use env X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=9801a32cf7607e0bbf94865a7d6690c92597cf61;p=nb.git dbq use env --- diff --git a/bin/dbq b/bin/dbq index 23e79bd5..ebfddc27 100755 --- 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