Questions tagged [stderr]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
28 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 ...
2
votes
1answer
61 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
0answers
29 views

Why not the stdout/stderr of my script as a systemd.service be redirected to journald?

I saw that systemd redirects all of stdout/stderr of a unit to journald by default, but I forget where I saw it. The output of my binary programs such as those compiled by gcc, has been redirected ...
0
votes
0answers
20 views

why does echo “something” >> file disappears? (written by another process) [duplicate]

I'm redirecting the stdout and stderr of a 3rd party process to a log file. I want to add markers to that log file, they disappear when I get the final file. 3rdParty-process &> log & <&...
0
votes
0answers
22 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 ...
0
votes
0answers
58 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 ...
43
votes
2answers
5k 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 ...
0
votes
1answer
725 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 ...
2
votes
1answer
597 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 ...
0
votes
1answer
508 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
2answers
319 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
1answer
68 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
1answer
3k 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 ...
1
vote
1answer
1k 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
1answer
150 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. ...
3
votes
1answer
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
1answer
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 ...
1
vote
2answers
911 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 ....
4
votes
1answer
2k 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 ...
1
vote
2answers
5k 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 ...
0
votes
2answers
3k 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 ...
-1
votes
1answer
1k 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 ...
2
votes
1answer
890 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 ...
21
votes
4answers
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
0answers
171 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 ...
8
votes
1answer
3k 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
1answer
395 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
votes
1answer
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
votes
4answers
17k views

Determine if output is stdout or stderr

How can I determine if what a process is outputting is stdout or stderr?
5
votes
2answers
1k 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 ...
0
votes
0answers
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/...
11
votes
7answers
5k 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 ...
0
votes
1answer
471 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 ...
1
vote
1answer
116 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 ...
10
votes
1answer
6k 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 ...
4
votes
1answer
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?
6
votes
3answers
11k 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 ...
5
votes
2answers
6k 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 ...
70
votes
7answers
90k views

cURL: how to suppress strange output when redirecting?

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
1answer
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
6answers
3k 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 ...