Skip to content

Cleanest and safest way to invoke long commands including pipes and/or chains #700

Answered by amoffat
sla-te asked this question in Q&A
Discussion options

You must be logged in to vote

The short answer is no. Acting like a full shell is outside of the scope of the project, even though it does include some shell utilities. Sh is primarily for command execution.

I would convert the trivial parts to Python and execute the non-trivial parts with sh. The example that you gave is all trivial, as Python can list directories, do regex comparisons, remove files, and tar files. If parts of the command called binaries that are not portable to Python, that's where you would use sh.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sla-te
Comment options

Answer selected by sla-te
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants