Questions tagged [stdout]
stdout is the name of the default output file descriptor of a process. Since there is nothing special about `stdout`, you *should not* use this tag. Use the [io-redirection] tag for questions on how to redirect output, use [file-descriptors] for questions on how to manage file descriptors, use [lock] for questions of file locking, and use [files] for general questions on file operations.
486 questions
15 votes
2 answers
2k views
Why does "seq 1000000 | tee /dev/stdout" produce more single-digit numbers than expected?
I'm in Linux and in Bash. I expect seq 1000000 | tee /dev/stdout to always output 9 numbers from 1 to 9 and their duplicates (18 in total). But when I do seq 1000000 | tee /dev/stdout | grep -c '^[1-...
7 votes
2 answers
1k views
How to find out if a command wrote to stdout or not
I'd like to figure out if an external program ran successfully and wrote something to stdout, or if it did not write anything, which happens in case an error occurred. The program unfortunately always ...
-1 votes
1 answer
136 views
Why is the printf Output Order Not Respected in a Concurrent Scenario with Piped or Redirected stdout?
We are in a concurrent scenario where we have n concurrent processes. By using a synchronization policy (e.g., using pipes or signals), each process can print using printf("string\n") only ...
0 votes
2 answers
544 views
Redirecting stdout with > and stderr with >> to same file leaves out stderr
I'm redirecting stdout and stderr to the same file by using > and >> respectively: rsync -a --exclude cache/ src_folder/ target_folder/ 1>out_err.log 2>>out_err.log However the ...
0 votes
1 answer
213 views
How to put all function/command call output results to different corresponding vars: for stderr, for stdout, for string result and for return code?
I want to extend question How to store standard error in a variable and get general solution (bash function or functions) to extract from the called function/command together with standard error also ...
2 votes
1 answer
165 views
How to "render" ouput from a command playing with tput so only the final terminal-postprocessed result is kept? [duplicate]
I captured the output of a script that uses tput to draw certain things on screen. When I perform cat myoutput then everything is well seen (looks like terminal reinterprets it from beginning), but ...
0 votes
1 answer
174 views
How to identify what file descriptors are associated to STDIN, STDOUT etc
I seem to remember some command or envvar that tells you this. I'd like basically something that executed on terminal, for instance, give you echo $STDIN /dev/tty echo $STDOUT /dev/tty fdescribe 0 or ...
0 votes
1 answer
187 views
Capture output from SOX "-n stat"
I am trying to capture/pipe the output from the following: arecord -f S16_LE -qd 5 file && sox file -n stat output: Samples read: 8000 Length (seconds): 1.000000 Scaled by: ...