This question already has answers here: Pipe output and capture exit status in Bash (15 answers) Closed 8 years ago. I have a shell script in which I wrap...
It works ok as a single tool: curl "someURL" curl -o - "someURL" but it doesn’t work in a pipeline: curl "someURL" | tr -d '\n' curl -o -...
I can’t seem to get jq to behave “normally” in a shell pipeline. For example: $ curl -s https://api.github.com/users/octocat/repos | jq | cat results in jq simply printing out...
I am trying to get bash to process data from stdin that gets piped into, but no luck. What I mean is none of the following work: echo "hello...
I am doing a find and then getting a list of files. How do I pipe it to another utility like cat (so that cat displays the contents of...
I would like to pipe standard output of a program while keeping it on screen. With a simple example (echo use here is just for illustration purpose) : $...
How do I detect from within a shell script if its standard output is being sent to a terminal or if it’s piped to another process? The case in...
This question already has answers here: Store output of subprocess.Popen call in a string [duplicate] (15 answers) Closed 3 years ago. How can I get the output of a...
I want to use subprocess.check_output() with ps -A | grep 'process_name'. I tried various solutions but so far nothing worked. Can someone guide me how to do it? 9...
I want to execute a long running command in Bash, and both capture its exit status, and tee its output. So I do this: command | tee out.txt ST=$?...