(read_lines/2 is a custom predicate that read all lines of output.)
To go on with my code, I must know if the command succeeded or not. But, reading docs, I didn’t find anything for this purpose.
Is there a way to get the bash exit code of the process?
Is it the small print at the very bottom of the docs?
Errors
process_error(Exe, Status) where Status is one of exit(Code) or killed(Signal). Raised if the process is waited for (i.e., Options does not include process(-PID)), and does not exit with status 0.
So you probably need to catch the error?
ie process_create/3 will throw this particular error if the exit code is not 0. You will also get the exit code as exit(Code).