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
126 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 ...
1 vote
0 answers
47 views
What is "NULL device *" warning on console
I am getting this message on the console of my AlmaLinux 9 host: [31178.107847] (NULL device *): port 1 already used(dev 6/1/4 stat 2 I've tried to google pieces of the message but getting no where. ...
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
1 answer
79 views
Why `dumpe2fs` writes its version number to standard error?
I want to do a simple grep on dumpe2fs output but I keep seeing dumpe2fs 1.46.5 (30-Dec-2021) showing up after my grep: $ sudo dumpe2fs -h /dev/sdb2 | grep 'Block count:' dumpe2fs 1.46.5 (30-Dec-2021) ...
0 votes
2 answers
548 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 ...
2 votes
1 answer
139 views
In zsh, annotate each line in a file to which both stdout and stderr have been redirected with the line's source (stdout or stderr)
In zsh, how can I annotate each line in a file to which both stdout and stderr have been redirected with the line's source (stdout or stderr)? I want output with the source name prepended to the line, ...
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 | ...
0 votes
1 answer
215 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 ...
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 | ...
4 votes
0 answers
269 views
Bash: Stderr being sent to a file (when it shouldn't be!)
The following code is on macOS as part of /etc/bashrc_Apple_Terminal, in order to save and restore the shell state across all open windows and tabs (note that this is therefore the very old bash 3.2....
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 ...
0 votes
1 answer
335 views
Calling a script from within csh with output redirection
What I would want: #!/bin/csh # call /myscriptpath/myscript.any and redirect 2>&1 and get retval and output set my_msg = `/myscriptpath/myscript.any` set my_ret = `echo $?` How to capture the ...
1 vote
1 answer
107 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 -...
4 votes
1 answer
1k views
How can I remove this annoying message: "Failed to find cgroup2 mount"?
I run this command ss -tulpnoea|grep -i water|grep -v 127 Failed to find cgroup2 mount Failed to find cgroup2 mount Failed to find cgroup2 mount Failed to find cgroup2 mount Failed to find cgroup2 ...
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 ...