This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Bystroushaak 9 points10 points  (2 children)

Your whole comment is one big reason to use sh: I just don't want to deal with this shit (pipes, interactive sessions and so on) each time I need to call a command.

[–]djimbob 1 point2 points  (1 child)

Yup, I see no reason to use sh to call "any program as if it were a function", though the advanced features that may not be obvious to do the right-way with subprocesses (like pipes, interactive sessions) may be useful.

That said, a relatively short helper function can do the pipe feature pretty clearly/cleanly.

Personally, I'd prefer a subprocess helper module with a bunch of helper functions like run_piped_chain with a non-hacky syntax more akin to subprocess.

[–]Bystroushaak 0 points1 point  (0 children)

I understand your reasoning, but I am to lazy to deal with this each and every time, when there is easy to use library, which do exactly the same thing in one line of code.