How to transfer values from bash to LO macro?

I’m a beginner and I’m using in a LibreOffice macro the shell command:

Shell(Pathname, Windowstyle, Param, bSync)

to activate some bash scripts. Reading the blogs I understand that variables value transfer is one-way, top to down. Is there a way to have back to the calling macro some values, integers or strings, or it is necessary to go throughout a .tmp file? If possible I would like to have some example code.

Hello,

afaik there is no way to get back output from your Shell command (neglecting error codes if bsync is set to true). You need to write to file and get the input from there.

It is not what I was hoping but, at least, I stop looking everywhere! I will use a file.
And also I learnt because the error code was always=0, due to bsync=true.
Thank you Opaque!

error code was always=0,

Just to clarify: This error code is not the return code of the shell command which has been executed by the Shell call. It is the error code whether the Shell call itself was correctly in terms of its syntax & parameters regardless of the return code of the executed command on the operating system level.

Thanks for the clarification. No hope of having something back!