> cat something | grep "this" | cut -f 1 | sed -e 's/.../.../'
Literally none of this is actually useful if you're already in Python:
(
line.split('\t')[0].replace(…, …)
for line in open('something')
if 'this' in line
)
> You end up writing too much codeI can believe that if you're calling to external processes to perform operations which are pretty much trivial in the language.
This question is specific to pipes.
That's missing what I'm noting though, which is that you don't need pipes anywhere near a shell script if you can simply do more of your work in-language. Case in point being that the entire pipeline you cited as an issue has no reason to exist outside of a shell or shell script.
It doesn't feel like the language was designed for these tasks.
But oh, if you do set -o pipefail the grep will stop the whole pipeline when none of the lines matches "this". So you have to keep fiddling with ${PIPESTATUS[0]}. And none of pipefail or PIPESTATUS are really portable.
Not so simple after all.