Questions tagged [stderr]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
71 views

PHP-FPM on Apache log issue

I am having trouble finding the cause of my php-fpm process logging its error output to the same location as the script result. I have an Apache server which passes requests to the php-fpm process ...
user10709800's user avatar
2 votes
1 answer
2k views

zsh: stdout and stderr both to console AND log

I'm converting a script from bash to zsh and have been floundering for days with the output. I want the stdout and stderr to both go to both the console and a log file. I've tried everything I can ...
Jim Worrall's user avatar
1 vote
1 answer
846 views

Batch: How to show only errors in console output (ie redirect STDOUT to NUL and STDERR to CON)?

I'm trying to figure out how to show only errors on the console output (and suppress all other output) without redirecting to a file or using TEE, etc. I'm trying to get this to work for single ...
Paul π's user avatar
  • 216
1 vote
2 answers
1k views

batch script - How to conditionally redirect output stream(s)

In summary, the goal is twofold: Create a logfile that only contains commands that have failed, plus the error messages those commands generate. Prevent console output (success or failure), except ...
Paul π's user avatar
  • 216
1 vote
1 answer
257 views

How do I fix /dev/stderr pointing to /dev/null instead of current terminal?

How do fix when /dev/stderr is pointing to /dev/null, because of which, all err messages are redirected to /dev/null without using the > operation. ~  tty /dev/pts/0 ~  l /dev/stdout lrwxrwxrwx ...
Codester Club's user avatar
5 votes
2 answers
6k views

ffmpeg less verbose, without hiding progress bar

Without editing and recompiling ffmpeg from source, how can one hide some of the many lines that it prints when it starts encoding, without also hiding its progress bar that updates every second or so ...
Camille Goudeseune's user avatar
1 vote
0 answers
20 views

What is the point of such handle redirection as 1<&2? [duplicate]

According to what is said here: For example, the following command redirects handle 2 (that is, STDERR) into handle 1 (that is, STDOUT): 1<&2 I understand why we might need to apply the ...
JConstantine's user avatar
0 votes
1 answer
262 views

Moreutils' Chronic reports everything in STDOUT, but only when run in cron

I prepared the following script to test chronic & cron: echo "normal out" echo "error out" >&2 exit 0 When I run it on normal shell with chronic -ev, output is as ...
Przemysław Czechowski's user avatar
0 votes
1 answer
521 views

why isn't putty getting SSH_MSG_CHANNEL_EXTENDED_DATA packets when TTYs are enabled?

Quoting RFC4254 § 6.6. Session Data Transfer, Data transfer for a session is done using SSH_MSG_CHANNEL_DATA and SSH_MSG_CHANNEL_EXTENDED_DATA packets and the window mechanism. The extended data ...
neubert's user avatar
  • 7,122
1 vote
1 answer
2k views

PowerShell Tee-Object also verbose logging

I use Tee-Object to output my command to console and a file. I use this command: Command 2>&1 | Tee-Object 'myfile.log' With this command I only get standard and error output in my file. When ...
Danny's user avatar
  • 197
3 votes
1 answer
149 views

Recalling last command inserts spurious character at the beginning (in Zsh)

The interactions are so complex that I don't know exactly what I'm looking for, but maybe you can still help. Sometimes, generally after an error (return code > 0), when recalling some last command, ...
user3341592's user avatar
0 votes
0 answers
37 views

Pipe second output (errors) in batch [duplicate]

I have a batch file in which I need to pipe an exe's output to a command. However, the output is reading as error messages so it is not piping it. For example: mycommand.exe > out.txt would have ...
Mark Deven's user avatar
  • 1,618
0 votes
0 answers
305 views

Why does the Windows Command Prompt COPY command write error messages to STDOUT not STDERR?

Normally if you try to copy a file that does not exist you get an error message: C:\temp>copy foo bar The system cannot find the file specified. I would expect that error message to be written to ...
RedGrittyBrick's user avatar
49 votes
2 answers
10k views

why it is 2>&1 and not 2>>&1 to append to a log file

I am redirecting STDOUT and STDERR to a single file, always growing, so I use always use "append" redirection; this is >> my command is command >> logfile 2>&1 And it works. But ...
Mikel Vergy's user avatar
3 votes
1 answer
6k views

Azure Pipeline Step Fails Even Though Exit Code is 0

I have set up an azure-pipeline yaml config with a pipeline job that runs 5 scripts. The config for each script has the failOnStderr flag set to true. The script runs successfully, however the stage ...
edmar's user avatar
  • 31
2 votes
1 answer
2k views

Pipe stderr to file and screen without redirecting stderr to stdout

In a bash script I'd like to execute a command while piping the stderr to both a file and to the terminal. However, I want stderr to stay on the '2' file descriptor so that I can parse it from an ...
Eddy's user avatar
  • 3,397
0 votes
1 answer
1k views

How to redirect stdout and stderr in bash script with dialog boxes?

For a single script redirecting stdout and stderr to a file with this: ./myscript.sh 2>&1 | tee -a out_file works fine. When I try to run the same way a script containing multiple dialog ...
coverflower's user avatar
1 vote
2 answers
487 views

ssmtp [email protected] < file.log doesn't work. Body is blank

I'm running a simple rsync script where I log stdout and stderr to two different files, rsync_stdout.log and rsync_stderr.log. When I'm trying to email the content of rsync_stderr.log using: echo $(...
brunobhr's user avatar
0 votes
1 answer
77 views

How to redirect stderr of ${var:?"foo"} syntax?

I am using bash and I am trying to print a message to standard error if a variable is not set with the following command: echo ${var:?"This var is not set"} Now, I want to redirect that error ...
Amjad Abdullah's user avatar
1 vote
1 answer
9k views

How do I redirect output from python to file

I want to redirect all output (stdout and stderr) of console to the text file. I make the following steps: Open cmd.exe Start command: "python.exe" > "file.txt" After that, I'm waiting for the ...
neo's user avatar
  • 111
1 vote
1 answer
2k views

Redirect STDERR and STDOUT to file with timestamp on each line

On my CentOS I am trying to execute a php script that contains an endless loop to do some fancy stuff inside. It doesn't matter that an endless loop may not be an accurate solution for most cases, but ...
Dolgsthrasir's user avatar
0 votes
1 answer
372 views

Modify terminal STDOUT/STDERR to change the line colour based on a REGEX

Is this possible? What I would like to achieve is when running unit tests (Python) to highlight any line which matches the path to the current project directory and leave other output untouched. ...
igniteflow's user avatar
4 votes
1 answer
4k views

shell standard streams redirection order OR 2>&1 1>/dev/null vs 1>/dev/null 2>&1

Can somebody please clarify differences? Is some of those considered as best practice? If I remember correct I somehow on SO read that this 1>/dev/null should precede this: 2>&1 ls -al /...
Wakan Tanka's user avatar
4 votes
2 answers
4k views

Linux shell: how to add prefix string to stderr message?

I am running several tasks simultaneously at background. command_a | tee > command_a.log & command_b | tee > command_b.log & If everything is fine, then messages will be saved to log ...
Fisher's user avatar
  • 687
1 vote
2 answers
2k views

How to redirect stderr of python3 script using tee pipe?

I am a Debian and RedHat user. I would like to redirect stderr (module logging) from a Python3 script. The script outputs a lot of things and the part I want to capture can be fetched using: python3 ....
jlandercy's user avatar
  • 125
5 votes
2 answers
3k views

Suppressing stderr in GNU Parallel

I'm using GNU Parallel to concurrently run a command several thousand times. To get logs of the execution I'm using --files and --results. To get nice progress bar while it's running I'm using --eta ...
Jasiu's user avatar
  • 171
1 vote
2 answers
7k views

How to quieten tcpdump output when reading a pcap file?

I notice that when using tcpdump to read a pcap file, the tcpdump command somehow manages to print information to my console even when I redirect both STDOUT and STDERR. How can I prevent tcpdump from ...
Steve HHH's user avatar
  • 7,110
1 vote
2 answers
5k views

How to redirect a part of stderr and stdout to /dev/null

My program outputs to stderr and stdout. I want to grep for "pattern" either in stderr and stdout. And I want the rest to be sent to /dev/null. If I pipe after redirect stderr : ./prog 2>/dev/null ...
Jav's user avatar
  • 113
-1 votes
1 answer
2k views

what are the types of error messages that dd outputs? [duplicate]

What are the error messages that dd outputs? I tried to look at manual, but it does not say anything about it. Or I do not know how to look at manuals (man). Edit: OK. I'll make it simple: what error ...
dding's user avatar
  • 787
3 votes
1 answer
2k views

What happens if dd encounters errors while output of dd is being piped to gzip?

Suppose that dd if=/dev/sda bs=100M | gzip -c > somefile.img.gz is done. If errors occur in dd, do I get to see error messages in terminal, or do they get ignored? Also, suppose that dd ...
dding's user avatar
  • 787
22 votes
4 answers
8k views

Why does the output of some Linux programs go to neither STDOUT nor STDERR?

Why does the output of some Linux programs go to neither STDOUT nor STDERR? Actually, I want to know how to reliably capture all program output, no matter what 'stream' it uses. The problem I have is ...
Will Sheppard's user avatar
1 vote
0 answers
204 views

redirect stderr of ldconfig from make to log file

A recent bzr branch broke my system and I'm having to boot into recovery mode to look at the source. In the recovery mode command line you cannot scroll. So I'm trying to recompile from source and ...
user avatar
10 votes
1 answer
4k views

Why can I see password prompts through redirecting output?

So, I've got a command that I'm issuing that is essentially 'ssh'ing into various hosts: command 2&>1 | grep "desired output" Every once in a while, in the midst of the command, it'll run ...
Matt Simmons's user avatar
3 votes
1 answer
679 views

Is it possible to send the output of -w and -o Curl streams to different files? How?

I'd like to run a curl command, grep the output (response payload) for some keywords, then also print some metrics via the -w option. I think this would be easy to do if I could direct the -o ...
Cheeso's user avatar
  • 2,139
3 votes
1 answer
2k views

Redirecting to /dev/null and a file at the same time

I'm trying to execute the following command: find . -name ".[ch]" | xargs grep -in pattern > file There are some errors that are printed on stderr because a few files are not found. How can I ...
VSN's user avatar
  • 35
34 votes
4 answers
28k views

Determine if output is stdout or stderr

How can I determine if what a process is outputting is stdout or stderr?
Rauffle's user avatar
  • 654
5 votes
2 answers
2k views

Missing segfault output in Linux terminal when running with "&"

I am debugging an application that has to run with other components. I am wrapping everything in a script: #!/bin/bash ./component1 > 1.log & ./my_application & ./component2 > 2.log ...
CuriousMind's user avatar
  • 1,981
0 votes
0 answers
3k views

bash: redirect the stderr/stdout of a running process?

I have a running process running in a bash terminal that is printing some prompt, and I would like to send it to the background with the stderr/stdout prompt that is printing either redirected to /dev/...
719016's user avatar
  • 4,347
15 votes
7 answers
10k views

Linux less behavior and stderr

I'm watching the output of my complicated command with less, problem is the stderr gets lost. stderr lines normally get listed inbetween stdout lines inside less. I would like them to be printed to ...
haelix's user avatar
  • 408
0 votes
1 answer
572 views

Linux : Rotating log buffer with output redirection

I have an application that prints errors on stderr. I can redirect that output to a file with app 2> log.txt (Un)fortunately I log tons of information. I'd like log.txt to not grow too much, or ...
user1190's user avatar
  • 630
1 vote
1 answer
406 views

Formatting bash errors

I am using Fedora 14 and when I am executing a file: #!/bin/bash asd #assuming this command does not exist I am getting following error: /path/to/file: line 2: asd: command not found I want to ...
Sebi's user avatar
  • 146
12 votes
1 answer
11k views

PowerShell and Tee

I use this command to see output both in the console and a file: powershell -command "my_command_1 | tee ('logs\{0}.log' -f (Get-Date -format 'yyyy.MM.dd-HH.mm'))" powershell -command "my_command_2 ...
race1's user avatar
  • 221
4 votes
1 answer
1k views

How to tee to stderr? (multiple sinks in one pipeline)

some_source | (tee /dev/stderr | sink_1) 2>&1 | sink_2 Seems to fail. How to do it right without of any temporaries?
Vi.'s user avatar
  • 17.2k
8 votes
3 answers
15k views

Using powershell call native command-line app and capture STDERR

I'm using a port of a cygwin tool on Windows which writes normal status messages to STRERR. This produces ugly output when run from PowerShell: PS> dos2unix.exe -n StartApp.sh StartApp_fixed.sh ...
yzorg's user avatar
  • 745
7 votes
2 answers
11k views

pipe a program into less

I'm taking the dive into setting up and learning git and at the same time learning bash. I'm trying to do something simple as view the help section of $ git config unfortunately, when I type that ...
coderdave's user avatar
  • 257
90 votes
8 answers
117k views

How to suppress cUrl's progress meter when redirecting the output?

I'm trying to print just the verbose sections of a cURL request (which are sent to stderr) from the bash shell. But when I redirect stdout like this: curl -v http://somehost/somepage > /dev/null ...
Ian Mackinnon's user avatar
1 vote
1 answer
2k views

How to I configure Eclipse PDT 2.1 to display PHP CLI output in the console?

Starting with a recent version of Eclipse PDT, the standard out and standard error from executed PHP CLI code doesn't appear in the console anymore. (It still shows up in the Debug-perspective in the ...
Christian Studer's user avatar
8 votes
6 answers
4k views

Immediately tell which output was sent to stderr

When automating a task, it is sensible to test it first manually. It would be helpful, though, if any data going to stderr was immediately recognizeable as such, and distinguishable from the data ...
Clinton Blackmore's user avatar