Skip to content

How to use pipes with $os.cmd()? #4946

Discussion options

You must be logged in to vote

I'm not sure how this could be easily done with the JSVM since we currently don't have a helper that will convert a writer into a string/bytes slice.

A simpler alternative could be to invoke the sh -c command instead, ex. $os.cmd('sh', '-c', 'ls | grep old')

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@AfdhalAtiffTan
Comment options

Answer selected by AfdhalAtiffTan
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