kangwonlee / kangwonlee/tutorial

Detect shell command error

Open
#14 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Jupyter Notebook
Stars
1
Forks
1
PR merge metrics
No merged PRs in 30d

Description

* `git checkout ` does not raise an exception
* `out = !git checkout ` would capture the output error message but seems not exactly desirable as a tutorial
* `%%script bash --out stdout --err stderr` captures `stdout` and `stderr` respectively

## References

* https://stackoverflow.com/questions/35857230/ipython-raise-exception-when-a-shell-command-fails
* https://jakevdp.github.io/PythonDataScienceHandbook/01.05-ipython-and-shell-commands.html
* https://ipython.readthedocs.io/en/stable/interactive/magics.html#cellmagic-script

## Observation

* Following cell would raise an error

``` sh
%%bash --out stdout --err stdout
git checkout
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.