Questions tagged [stdout]

The standard output stream (stdout) is the stream where a program writes its output data.

4740 questions
2
votes
1 answer

Silence docker rm command in bash

I tried docker container rm container-name > /dev/null but this still prints Error: No such container: container-name. I'm trying to silence this error in my bash script.
Dave
  • 457
  • 1
  • 7
  • 16
2
votes
1 answer

Python code hangs when using a subprocess with a large amout of output to stdout

I have a subprocess that can output a lot of data to stdout. When too much data is generated it causes the subprocess to hang since it is waiting for the stdout buffer to be emptied. Here is a small example…
Calab
  • 351
  • 4
  • 20
2
votes
1 answer

Why does the shell output go to stderr?

I'm using the subprocess module from python and whenever I call any of the methods that subprocess has to run, in this case some bash code on the shell, the output (lets say from a command e.g iwconfig) is redirected to stderr. Shouldn't the output…
VladiC4T
  • 216
  • 2
  • 10
2
votes
0 answers

C# process to get image from ffmpeg stdout

We need to read some RTSP streams in C# using ffmpeg and pipe the stdout to a MemoryStream. We need to get a snapshot out of each stream. Here's my code so far: var arguments = $@" -y -i {imageUri.AbsoluteUri} -vframes 1 -pix_fmt yuvj420p -vf…
Alex
  • 34,699
  • 13
  • 75
  • 158
2
votes
1 answer

Printing output of python script to Windows console, when running via batch file

I have tried to look at other resources on SO but none seem to solve my problem: Executing Python Script From Command Line is Hiding Print Statements How do I write output in same place on the console? Python script doesn't print output in command…
Julian Drago
  • 719
  • 9
  • 23
2
votes
1 answer

bash linux - write and read from stdin and stdout

I have an application which I can run from the commonand line and it acts like a CLI for me. However its part of a suite of applications and now I want them all to run on boot up and so they are being started as a service (systemd). So all my apps…
code_fodder
  • 15,263
  • 17
  • 90
  • 167
2
votes
1 answer

How to terminate the logging process inside a shell script withput stopping the script?

I am working with a shell script to run my analyses. To make sure, I can confirm the correct commands were executed, I am writing the complete STDOUT/STDERR output into a file My script looks like that: #!/bin/bash # Here are some pliminary…
Assa Yeroslaviz
  • 590
  • 1
  • 9
  • 22
2
votes
1 answer

python redirect stdout with print function, is it possible to extend to multiple outputs, and what's the timing?

I have read several questions on how to use print function to write on file by redirecting standard output. I find it potentially useful for logging (where logging module is sometimes inconvenient), but I wonder if there is a way to send the output…
Vincenzooo
  • 2,013
  • 1
  • 19
  • 33
2
votes
3 answers

Why redirecting to stdout with dup2 works only if printf was called before redirecting

I'm trying to write a program that connects to a server opened with nc -v -l 1337 on another terminal, and redirects stdin, stdout, stderr to the socket. Meaning, the other terminal will write to the socket, and my program will read it with…
Nadav G
  • 23
  • 4
2
votes
1 answer

Process.Start does not redirect message to the parent context hosted by docker?

This issues has taken me one day, really I just thought it's simple at first. I have a host machine (Windows 10) with Docker desktop for Windows installed. From the host machine, I would like to use docker run to start a container which contains…
Hopeless
  • 4,397
  • 5
  • 37
  • 64
2
votes
0 answers

C# Do I need to read stdout on separate thread?

In C#, I am trying to run a command line program that gets input from stdin and then it returns the output to stdout . I need to keep cmd.exe running (using /k) and in a for loop, send in text and then wait for the output before sending the next…
dmkoher
  • 21
  • 2
2
votes
1 answer

Python how do I print value instead of prompt

I keep running into a _stdout error with a print statement within the browser IDE provided by Pearson, yet the error does not occur when using Wing 101 IDE. I need the print statement to only output each variable (an integer(k), a double(d), and a…
Kait
  • 37
  • 4
2
votes
0 answers

Unable to read stdout from python with popen in lua

I am trying to read the stdout of a simple python script import time while True: print("test") time.sleep(1) with the following lua code local p = assert(io.popen("/usr/bin/python test.py", "r")) if not p then …
2
votes
0 answers

Python: Capture stdout of crashed program via subprocess

I have a simple C program that asks for input and echoes it back, so essentially a gets and then a printf. I want to call this program through Python subprocess and capture the output - even when the C program crashes (trying to overflow the buffer…
user1683766
  • 189
  • 1
  • 11
2
votes
3 answers

Grep python output stream (tried print and stdout)

This answer says it's as simple as: pipe python logging stdout stream output to grep python main.py 2>&1 | grep INFO I have the following file, which I've tried with print() and sys.stdout.write(). import sys from time import sleep while True: …
Alexander Kleinhans
  • 5,950
  • 10
  • 55
  • 111