Questions tagged [stderr]
The standard error output stream (stderr) is typically used by a program to output error messages or diagnostics.
1,341
questions
-1
votes
0
answers
29
views
stderr and stdout - I am not getting stdout
I am following this guide:
$ ls /fake/directory &> peanuts.txt
And I am not getting both of them in peanuts.txt
My output:
ls: cannot access /fake/directory: No such file or directory
1
vote
2
answers
26
views
How do I ask nohup not to redirect stderr to stdout if it is detached from terminal?
This question looks naive but I can't find the answer after half an hour of intensive searching. Basically I do not want stderr messages to sneak into my result file.
$nohup ./a.out | gzip -c > ...
0
votes
0
answers
32
views
PowerShell try/catch error stream writing to console out of order [duplicate]
I wrote a basic script to show how to catch terminating and non-terminating errors (using exception classes will be a future demonstration topic).
In the 2nd try/catch block I added a simple $_ | Get-...
0
votes
0
answers
35
views
Read stderr in bash?
I'm making a BASH script for a setup program made using the dialog command. The man page for the command says it outputs exit codes to standard error. How do I read standard error without redirecting ...
0
votes
0
answers
16
views
subprocess not returning meaningful error messages
What specific syntax must be changed in the Python code below in order for the python function to return the same correct error
message that the CLI command below is returning?
THE CORRECT ERROR ...
2
votes
2
answers
57
views
find -exec - suppress errors only for find, but not for executed command
When running the find command, it may output "No such file or directory" errors.
As answered to the find - suppress "No such file or directory" errors question here: https://...
1
vote
1
answer
29
views
Serializing err.h calls in a mulit-threaded program
My program uses the <err.h> functions (like warnx(3)) to emit diagnostics. Sometimes multiple threads do the reporting at the same time, resulting in the output lines overlapping.
It is not a ...
0
votes
0
answers
41
views
Standard error and standard output redirection in Laravel cron job
There is a command for cron jobs in Laravel documentation:
* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
Is this command the same?
* * * * * cd ...
0
votes
0
answers
33
views
Write log output only on stdout python
I have the following code:
import logging
log = logging.getLogger(__name__.replace('__',''))
log.setLevel(logging.DEBUG)
format = logging.Formatter("%(asctime)s:%(levelname)s:%(message)s")
...
0
votes
0
answers
28
views
Can not see Unpacking report of Git command in C# process output
I use the Process object for executing git command (Fetch). Complete command body is "$ git fetch --progress --verbose "origin" main:remotes/origin/main"
private async Task<...
0
votes
1
answer
39
views
How to redirect stdout and stderr to the same file
How to redirect both standard output and standard error to the same file?
so if there is a command like grep "ABC" /etc/passwd > output
this only directs the standard output to this file
...
0
votes
0
answers
18
views
Why QProcess is not showing stdout from bash script executed in remote server?
I made an script (findx.h) that doesn't have any problem when i ran it on Solaris server via console (bash-3.2$ ./findx.sh)
The problem appears when i try to run it from a windows Qt app using ...
0
votes
1
answer
60
views
Recreating/reattaching AWS Lambda console logging to CloudWatch
Thinking that I wanted to clear out old logs, I made the mistake of deleting my Lambda's "Log Stream" on CloudWatch.
The result, as I should have expected if I was awake, is that now ...
0
votes
0
answers
80
views
How to catch stderr inside a docker container?
I've built a docker image named conda with several dependencies. And I've written a node.js script to launch a container of this image. However, I cannot catch exceptions that I raise inside the ...
0
votes
0
answers
16
views
Unable to suppress console output from Bash script [duplicate]
Trying to write a bash script to install and configure samba. Have added a control statement to check if samba is already installed. This takes dpkg output and pipes it into grep and checks if output ...
0
votes
1
answer
35
views
How to get all stderr within a for loop?
I want the stderr of all files within a for-loop. So far only the first one in the for loop was written into summary.txt.
My codes:
SAMPLES="SRR1 SRR2 SRR3 SRR4"
for SAMPLE in $SAMPLES;...
1
vote
1
answer
41
views
Redirect stdout/stderr of a script to a file along with command itself and the result stderr of time command
My chain command: mkdir mydir; mv myscript.py mydir/; python3 mydir/myscript.py;
Redirect stdout and stderr of myscript.py to log.txt.
$ mkdir mydir; mv myscript.py mydir/; python3 mydir/myscript.py ...
0
votes
1
answer
32
views
How to add additional info to stderr output when bash script calls another application
On Ubuntu, I have a bash script that runs an application.
When that app seg faults, I get some info in std err, e.g.
/usr/local/foo/script.sh: line 21: 494382 Segmentation fault (core dumped) ...
0
votes
0
answers
30
views
Can you intercept ALL messages sent to sys.stderr and sys.stdout?
I am trying to "capture" all messages sent to the console at code runtime; Python's redirect_stdout and redirect_stderr do not work for my application.
Goal
Maintain a printing animation for ...
0
votes
1
answer
48
views
Getting an error when performing t-test on log-transformed data
I want to run two t-tests on some data I have on crab and lobster landed weight in North and South Wales, one separate test for each species at the moment. I have log-transformed both weight columns ...
1
vote
1
answer
35
views
Bash - Command substituting $(ping google.com) outputs to terminal [duplicate]
I've been writing a script whose weird behavior's been driving me nuts, but I've managed to find what might be the problem: command substituting like this
out="$(ping google.com)"
if done ...
1
vote
1
answer
70
views
How can I read the error message from stderr?
We are studying Pipes and I have to create a C code that reads the error message from compiling another c program. I am using dup2 to copy stederr to writing side of the pipe, after that I use read ...
-3
votes
1
answer
190
views
Capture and inherit stdout and stderr using std::process::Command
With Rust it's very easy to run a command that either inherits stdout and stderr OR captures them. Is there a way I can do both simultaneously (and in real-time)?
0
votes
1
answer
106
views
Finding corrupted videos with opencv
I have huge video dataset (about 500000 16 frame length clips). Some of the videos produce messages like
[mpeg4 @ 0x561b46a44b80] marker does not match f_code
[mpeg4 @ 0x561b480c0740] Error at MB: ...
0
votes
1
answer
45
views
Why floating point error message is not printing on stderr?
I am running c language code using a java application using java.lang.ProcessBuilder. If any output and error generated by this c language code, I am able to read those via process.getInputStream() ...
0
votes
2
answers
51
views
stderr out to a variable
I have a bash script that iterates through a list of file locations (filepath) and deletes them. I'd like to have any errors that the command throws (like permission issues) go to an individual log as ...
0
votes
1
answer
28
views
Extracting specific value from stderr_lines
This is my ansible script
- name: show1
debug:
msg: "{{response.stderr_lines}}"
Here is the output
msg:
- Using endpoint [https://us-central1-aiplatform.googleapis.com/]
- ...
0
votes
0
answers
29
views
Is there a standard way to format error messages?
I have seen this page from the GNU Coding Standards:
https://www.gnu.org/prep/standards/html_node/Errors.html
There are some global guidelines about the program, line and column of the error and ...
1
vote
1
answer
45
views
Trouble running a custom monit check, stderr maybe?
Trying to run this check from monit, but it doesn't work. The gravity program sends its output to stderr. Could it be that monit doesn't handle this properly because of the way it exec's the check?
...
0
votes
1
answer
49
views
How to hide any error or any stderr in Python?
I know there is a way I should use try catch (try - except) concept to hide any error or warning.
But is there a recommended way to hide all or any python error like PHP use error_reporting() function ...
0
votes
3
answers
111
views
Bash script - Modify output of command and print into file
Im trying to get text output of specified command, modify it somehow (e.g. add prefix before output) and print into file (.txt or .log)
LOG_FILE=...
LOG_ERROR_FILE=..
command_name >> ${LOG_FILE} ...
0
votes
1
answer
28
views
JavaScript console.error redirect to file in Daphne Django application
I am using systemd (on Debian) to launch a shell script (as me as a user):
startup.sh:
#/bin/bash
daphne -b '0.0.0.0' -p 8000 myProject.asgi:application 2> /tmp/log.out
In my Python (Django) ...
0
votes
1
answer
29
views
php run command line and pipe std err to variable
I am trying to figure out how to run a command line program within php and output both stout and stderr to a variable. All the examples either output the command line directly to the screen, or only ...
0
votes
1
answer
59
views
Why is the output order different from the call order when using fprintf with stdout or stderr?
My environment is Debian GNU/Linux 11.
The fprintf function with param stdout or stderr gives unexpected output order.
int main() {
std::cout << "Hello, World!" << std::endl;
...
1
vote
1
answer
49
views
Error redirection in the body of the bash shell function [duplicate]
I have a script like the one below:
#!/bin/bash
#func.sh
func(){
badcommand1
echo "OK"
badcomand2
}
func 2>&1 > err.log
#The top line is in the file
My goal is to redirect all ...
1
vote
1
answer
92
views
Powershell error message in console is being wrongly indented
What I am trying to do is run the wsl process, get its stdout and stderr channels to print to console as if they were executing normally, throw an error in powershell if stderr and for the printout to ...
0
votes
0
answers
77
views
Redirect console prints from Xcode
While developping an app for an iPad on my Mac, I use print logs to monitor what is going on (regular prints in Swift code). However I really don't like the Xcode console, and I'd like to be able to ...
0
votes
0
answers
9
views
Android Studio creates files in wrong place (command, stderr, stdout ...)
Android studio, when I run apps in the emulator, started from today to create some files in the root of the disk that contains the project.
The files are:
android_gradle_clean_command_0.txt
...
0
votes
1
answer
55
views
python subprocess does not capture stderr of a pv command
I need to run some bash script with python and show the output. Some of these scripts contains some pv command but from subprocess I am not able to get the pv output.
import subprocess as sp
p = sp....
0
votes
1
answer
55
views
Unable to read child stderr twice in Rust
For some reason, I am unable to read from the child process stderr the second time. Here is what I do.
I am spawning a child process for cucumber tests. In the first step I spawn the process, take its ...
0
votes
1
answer
49
views
Shell script not sending output to file
Whenever I run the following command in the terminal, the stderr and stdout is sent to the output.txt file just like I would expect.
/usr/bin/time -v ls -al &> output.txt
However, whenever I ...
3
votes
1
answer
86
views
How to capture messages written to stderr by OpenCV?
In case of invalid parameters, cv2.VideoWriter writes stuff to stderr. here is a minimal example:
import cv2
cv2.VideoWriter("foo.mp4", cv2.VideoWriter_fourcc(*"mp4v"), 90000, (...
1
vote
1
answer
47
views
Shell prompt does not shows on socket
I want to establish a remote shell over tcp.
I already got it to work, but there's a small issue:
The prompt does not shows up on client side.
If my client input echo hi, it well prints hi on stdout (...
3
votes
2
answers
138
views
How to append stdout and stderr to file in specified directory using CWL (Common Workflow Language)?
I have been try to write in CWL a description that appends stdout and stderr to a file in a specific directory, something like printf 'some message' >> out_directory/out_file 2>&1
With ...
0
votes
0
answers
42
views
How to direct STDOUT from GMSH call to a callback function that accepts a char array?
I have added a callback function to my Native C++ code to return information about my GMSH calls to my C# code. The function accepts a char array like so: typedef void(__stdcall* ProgressCallback)(...
0
votes
1
answer
50
views
CRON job not capturing changes in script
I have a cron job like this
*/5 * * * * /vault/configure_snapshots.sh > /var/log/cron/snapshots
I created a script and uploaded it during initialization (e.g. AWS EC2 user-data).
Afterwards I ...
2
votes
0
answers
283
views
RuntimeError: reentrant call inside <_io.BufferedWriter name='<stderr>'> on gunicorn
Someone can help me with the error below?
If I run the code directly from shell the sever works fine and I can see the page on browser.
But if I run the systemd service I've got this error:
...
0
votes
1
answer
136
views
Redirecting standard error to a file in c
I am making my own shell in c and i am now trying to make a function which redirects the standard error of the shell to a specific file, an option which manages to show where the standard error is ...
0
votes
1
answer
15
views
Why is there no extra channel for error or status?
I have a question on Client-Server-Computing.
Why is there only one connection from the server back to the client? In UNIX you normally have stdout and stderr.
Background:
Database-queries might take ...
1
vote
1
answer
30
views
Capturing output to variable only works with redirection
I know that the construct to capture stdout to a variable is var=$(...). However why does the following not work?
docker pull nginx
version=$(docker run --rm --entrypoint nginx nginx:latest -version)
...