4 ms·
Ah, so using python for stuff bash is usually used for. I thought OP meant writing python scripts to be used as components of bash scripts. For _that_ type of
by sprayk 13y ago
Ah, so using python for stuff bash is usually used for. I thought OP meant writing python scripts to be used as components of bash scripts.
For _that_ type of python, I usually use the sh module[0]. It handles piping pretty well, especially if you use StringIO to deal with the pipes. Unfortunately, return code-based conditionals are nowhere as simple as || and && are in shell.
[0] http://amoffat.github.io/sh/ http://amoffat.github.io/sh/