From 65386be39bb095290217bbd35ea762181b92640f Mon Sep 17 00:00:00 2001 From: Aleksander Kantak Date: Mon, 18 Sep 2023 18:15:42 +0200 Subject: [PATCH 1/2] Fix calling executables through $PATH Signed-off-by: Aleksander Kantak --- agent/agent | 2 ++ agent/agent.bat | 1 + agent/mpstat.bat | 1 + hammerdb | 2 ++ hammerdb.bat | 1 + hammerdbcli | 2 ++ hammerdbcli.bat | 1 + hammerdbws | 2 ++ hammerdbws.bat | 1 + 9 files changed, 13 insertions(+) diff --git a/agent/agent b/agent/agent index 33da4060..9c698519 100755 --- a/agent/agent +++ b/agent/agent @@ -1,6 +1,8 @@ #!/bin/sh ######################################################################## # \ +cd "$(dirname "$0")" +# \ export LD_LIBRARY_PATH=.././lib:.././lib64:$LD_LIBRARY_PATH # \ export PATH=.././bin:$PATH diff --git a/agent/agent.bat b/agent/agent.bat index 8308bd05..6c2436c9 100755 --- a/agent/agent.bat +++ b/agent/agent.bat @@ -1,3 +1,4 @@ @echo off +cd /D "%~dp0" set path=..\.\bin;%PATH% START tclsh86t .\agent diff --git a/agent/mpstat.bat b/agent/mpstat.bat index 55c1bd2d..2de74726 100755 --- a/agent/mpstat.bat +++ b/agent/mpstat.bat @@ -1,5 +1,6 @@ ::if 0 {--*-tcl-*-- @echo off +cd /D "%~dp0" set path=..\.\bin;%PATH% if "%OS%" == "Windows_NT" goto WinNT tclsh86t "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/hammerdb b/hammerdb index 4ac8c79e..3bc61b60 100755 --- a/hammerdb +++ b/hammerdb @@ -1,6 +1,8 @@ #!/bin/sh ######################################################################## # \ +cd "$(dirname "$0")" +# \ export LD_LIBRARY_PATH="./lib:$LD_LIBRARY_PATH" # \ export PATH="./bin:$PATH" diff --git a/hammerdb.bat b/hammerdb.bat index f40c26e1..8b296d92 100755 --- a/hammerdb.bat +++ b/hammerdb.bat @@ -1,4 +1,5 @@ @echo off +cd /D "%~dp0" set path=.\bin;%PATH% START wish86t -file .\hammerdb %1 %2 exit diff --git a/hammerdbcli b/hammerdbcli index 8c1e2e10..7ad1143b 100755 --- a/hammerdbcli +++ b/hammerdbcli @@ -1,6 +1,8 @@ #!/bin/sh ######################################################################### ## \ +cd "$(dirname "$0")" +## \ export LD_LIBRARY_PATH="./lib:$LD_LIBRARY_PATH" ## \ export PATH="./bin:$PATH" diff --git a/hammerdbcli.bat b/hammerdbcli.bat index e8b34c5f..452745f6 100755 --- a/hammerdbcli.bat +++ b/hammerdbcli.bat @@ -1,5 +1,6 @@ @echo off COLOR 07 +cd /D "%~dp0" set path=.\bin;%PATH% CALL tclsh86t hammerdbcli %1 %2 %3 %4 exit diff --git a/hammerdbws b/hammerdbws index 4437eea9..158ba72c 100755 --- a/hammerdbws +++ b/hammerdbws @@ -1,6 +1,8 @@ #!/bin/sh ######################################################################### ## \ +cd "$(dirname "$0")" +## \ export LD_LIBRARY_PATH="./lib:$LD_LIBRARY_PATH" ## \ export PATH="./bin:$PATH" diff --git a/hammerdbws.bat b/hammerdbws.bat index 375f3bd8..e64af83b 100755 --- a/hammerdbws.bat +++ b/hammerdbws.bat @@ -1,5 +1,6 @@ @echo off COLOR 07 +cd /D "%~dp0" set path=.\bin;%PATH% CALL tclsh86t hammerdbws %1 %2 exit From be62d298901c12cbc55401b3ddd1f2f645976e4d Mon Sep 17 00:00:00 2001 From: Aleksander Kantak Date: Tue, 19 Sep 2023 17:23:10 +0200 Subject: [PATCH 2/2] Fix agent file path - extract filename only --- agent/agent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/agent b/agent/agent index 9c698519..7d852778 100755 --- a/agent/agent +++ b/agent/agent @@ -7,7 +7,7 @@ export LD_LIBRARY_PATH=.././lib:.././lib64:$LD_LIBRARY_PATH # \ export PATH=.././bin:$PATH # \ -exec .././bin/tclsh8.6 $0 ${1+"$@"} +exec .././bin/tclsh8.6 ${0##*/} ${1+"$@"} # \ exit ########################################################################