Getting hold of error status from an external command?

ryofurue
Sun, 02 Mar 2025 03:50:55 +0000
General Usage

I found the following old thread discussing the same problem. Is this

proc = spawn(pipeline(ignorestatus(cmd)))

still the best way to get hold of the exit code?

I wish these commands (run() etc) had an option to return a proc object instead of throwing an exception.

How to handle error statuses and exit codes in Julia while invoking external commands? General Usage

Hi, I am trying to run an external command from Julia using the run() function, but I am stuck on how to handle error codes and exit codes of any particular command. Previous Julia version had a readall() function, which isn’t available anymore. Something like, stdout,stderr = run(`some command`) Although I do get the stacktrace and error printed on the console.(May be the default behaviour causes it to dump everything to STDOUT)

6 posts - 3 participants