Getting hold of error status from an external command?

I do it like this:

julia> cmd = Cmd(`which`; ignorestatus=true)
`which`

julia> t = run(cmd)

?Invalid usage. Type 'WHICH -?' for help

julia> t.exitcode
2
1 Like