Questions tagged [stderr]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
78 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 ...
2 votes
2 answers
2k 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 ...
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 ...
0 votes
1 answer
143 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 ...
0 votes
1 answer
274 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 ...
  • 6,101
1 vote
1 answer
721 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 ...
  • 197
2 votes
1 answer
87 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, ...
0 votes
0 answers
34 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 ...
  • 1,318
0 votes
0 answers
176 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 ...
47 votes
2 answers
7k 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 ...
1 vote
1 answer
3k 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 ...
  • 11
2 votes
1 answer
925 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 ...
  • 3,247
0 votes
1 answer
886 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 ...
1 vote
2 answers
479 views

ssmtp myaddress@gmail.com < 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 $(...
0 votes
1 answer
73 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 ...
1 vote
1 answer
6k 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 ...
  • 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 ...
0 votes
1 answer
243 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. ...
4 votes
1 answer
3k 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 /...
3 votes
1 answer
3k 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 ...
  • 538
1 vote
2 answers
1k 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 ....
  • 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 ...
  • 171
1 vote
2 answers
6k 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 ...
  • 6,790
1 vote
2 answers
4k 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 ...
  • 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 ...
  • 677
2 votes
1 answer
1k 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 ...
  • 677
22 votes
4 answers
7k 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 ...
1 vote
0 answers
184 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 ...
's 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 ...
3 votes
1 answer
527 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 ...
  • 2,100
2 votes
1 answer
1k 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 ...
  • 25
29 votes
4 answers
23k views

Determine if output is stdout or stderr

How can I determine if what a process is outputting is stdout or stderr?
  • 604
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 ...
  • 1,901
0 votes
0 answers
2k 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/...
  • 3,839
14 votes
7 answers
8k 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 ...
  • 338
0 votes
1 answer
508 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 ...
  • 600
1 vote
1 answer
246 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 ...
  • 148
10 votes
1 answer
9k 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 ...
  • 201
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?
  • 16.1k
8 votes
3 answers
14k 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 ...
  • 767
7 votes
2 answers
9k 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 ...
  • 237
90 votes
8 answers
114k 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 ...
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 ...
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 ...