I'm building a CLI that, when run, requires the output of the most recently executed bash command. Is it possible to pull this output without recomputing the command?
For example, let's say I run python main.py
and receive this error:
File "main.py", line 41
messages_list.insert(0, { "author" : "dummy_author0", "message" : " " } )
^
IndentationError: unindent does not match any outer indentation level
I'd like to then run a command that automatically pulls this error message and does something with it, without re-running python main.py
.
I'm thinking that running command1; command2
could provide a way for command2
to pull the output of command1
since the execution of both in sequence might be treated as a single process, but I'm not sure how.