I have two jshell scripts script.jsh and commons.jsh in the same folder /path/folder
.
script.jsh:
/open commons.jsh
commons.jsh:
System.out.println("commons.jsh loaded")
- If I am in
/path/folder
, I can runjshell script.jsh
and it works well - If I am in
/path/folder/subfolder
and I runjshell ../script.jsh
, it fails withFile 'commons.jsh' for '/open' is not found
.
Is there any solution to this? In other words, can the jshell command /open
work relatively to the folder containing the script, instead of the working directory?
A similar question was asked here for bash: Bash: How _best_ to include other scripts?
Edit1: making the question more precise
Edit2: here are the real jshell scripts that I was working on when writing this question, the first script available here https://framagit.org/Gwendal/helpful-scripts/blob/3e8118970a6a412dfe0f199e93545745d890243f/jshell/dia2pdf.jsh which opens this second script containing a helper method https://framagit.org/Gwendal/helpful-scripts/blob/3e8118970a6a412dfe0f199e93545745d890243f/jshell/commons.jsh