question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

how to pipe string to rest of commands

See original GitHub issue

Hi! I would like to simplify my usage of subprocess and so i found your work. It would seem that it does what is advertised to do (just trying to say that is an amazing project) but documentation is a bit lacking … i do not find a way to pipe a string to a custom chain (something like echo stdout_from_other_process | chain_of_shell_commands_that_will_run_in_my_pseudo_terminal). Could someone give me a hint about it? 😃
Thank you!!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
adriansevcommented, Mar 27, 2019

wow! thanks a lot for your help and info!!

0reactions
timofurrercommented, Mar 27, 2019

Well, besides the security risks you are facing there you would have to escape single quotes yourself for string1. Maybe something in https://docs.python.org/3/library/shlex.html helps you to escape.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pipe string with newline to command in bash? - Stack Overflow
try echo -e "${message}\n${changed}" | /usr/bin/php -q /home/chad/www/mantis.localhost/scripts/checkin.php. where -e enables interpretation ...
Read more >
bash - How to pass a string to a command that expects a file?
You can use the "fake" filename /dev/stdin which represents the standard input. So execute this: echo "$the_recipe" | cook /dev/stdin.
Read more >
how to pass string comand to shell pipe to execute it (output of ...
So i first wanted try it execute manually from bash to see if it works before i put it in the awk print...
Read more >
How to pipe command output to other commands? - Super User
What I do in these situations is something like: ls | while read OUT; do echo $OUT; done but this is rather cumbersome....
Read more >
Working with pipes on the Linux command line - Red Hat
One of the most powerful shell operators is the pipe ( | ). The pipe takes output from one command and uses it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found