Questions tagged [stderr]
Standard error is another output stream typically used by programs to output error messages or diagnostics.
246 questions
1 vote
1 answer
124 views
If fprinting to stderr fails, which error code should a C program return? [closed]
Assume the following C snippet showing a piece of error handling: #include <sysexits.h> #include <stdio.h> … int main(int argc, char argv*[]) { int retval=0; … if(3!=argc) { /* wrong ...
10 votes
5 answers
2k views
Recommended way for a Linux app to inform user of an exception
In this context, an 'exception' is an undesirable scenario, which could be: a code-level signal (like SIGSEGV), incorrect ways of launching an app (like launching a command-line app as a daemon) etc. ...
0 votes
2 answers
545 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
103 views
How can I get stderr from mbuffer written to log file when using tee?
Having a bash script that essential only doing: mbuffer --md5 -i dummy.tar -o /dev/null A user of this script wants to use tee and store the output messages in a log file. ./script.sh 2>&1 | ...
1 vote
2 answers
2k views
Is it possible to read from stderr in a bash script?
I have a bash script like this: #!/bin/bash while read -r -a line do ... parse $line in some way done This script is executed by piping the command from another program: some-random-program | ...
3 votes
3 answers
2k views
When and where are the standard in, out, and error file descriptors first opened in linux?
Where are stdin, stdout, and stderr (the fds) first opened? Is it the kernel that does it? And when and where are the symlinks /dev/std{in,out,err} made? Where is the code that does it? I assume it is ...
1 vote
1 answer
106 views
Find number of process running using fuser
We are using fuse to find the logs associated to particular port. fuser /test/log* This results in a list of logs associated with port How to find the number of lines on the output? I tried with |wc -...
0 votes
0 answers
128 views
Already using stderr, how do I detect if there was an error in a bash script
I am backing small databases from several websites and sending the admin an email with the results. I have already directed stderr to send the complete error in the email. Is there a way I can ...