On 2024/01/04 19:44:01 +0000, Mik J <[email protected]> wrote:
> [...]
> I still have a question Omar, you wrote that the pexp content would be matched
> "the daemon is found by looking for a process matching that pexp and killing
> it."
>
> Here I have
> pexp="$(/usr/local/bin/javaPathHelper -c opensearch)
> .*org.opensearch.bootstrap.OpenSearch.*"
the $(...) part is evaluated and its output then substituted, so the
pexp effectively is
/usr/local/jdk-11/bin/java .*org.opensearch.bootstrap.Opensearch.*
You can double-check by just copy-pasting pexp="$(...) ..." in a shell
and then dumping the value of pexp, for e.g.: echo $pexp
Just like you've found, you may get a slightly different java path
depending on what you've set JAVA_HOME to.
(maybe javaPathHelper could strip extra / at the end; it would have
prevented this issue.)
Cheers,
Omar Polo