Standard error is another output stream typically used by programs to output error messages or diagnostics.

learn more… | top users | synonyms

0
votes
1answer
25 views

Redirecting stdout and stderr still prints to stdout

I'm getting an some kind of error at the VGA console when I make a configuration file for grub (at least I think it's an error), with grub-mkconfig -o /boot/grub/grub.cfg I tried to redirect stderr ...
4
votes
2answers
32 views

Direct stderr to a file over ssh

I am trying to execute a command on a local machine and direct the stderr to a remote machine over ssh. I cannot do ssh remote machine "command 2>stderr.log" because the remote machine doesn't ...
1
vote
2answers
65 views

where is the location of stdin, stdout, stderr file descriptor in AIX(unix)

In my Linux environment, the file descriptors are located on /dev/fd. Where is the location of stdin, stdout, stderr file descriptor in AIX(unix). I couldn't find them.
1
vote
1answer
30 views

View the recent stderr output for a terminal window

I'm using Linux Mint 13, MATE edition. I've just run a lot of very slow rsync processes which created a huge amount of output to STDOUT. The last one also outputted a message (presumably to STDERR, ...
2
votes
1answer
31 views

Print stderr only if nothing gets written to stdout, otherwise print just stdout discarding stderr

There's a command that always prints stuff to stderr. Such information is never useful except when it doesn't write anything to stdout. So, is there a simple shell way, tool or command to help ...
0
votes
2answers
58 views

How to grep stderr? [duplicate]

How do I grep this command that includes a wildcard? How do I grep stderr? The grep does not seem to do anything: $ less /Users/raine/.nvm/versions/node/v5.5.0/lib/node_modules/* | grep "Not a file"...
0
votes
1answer
22 views

Redircting stdout to file, but duplicating stderr to both file and terminal [duplicate]

Redirecting stderr to file and duplicating stdout to both file and terminal is easy: $ prog 2>error.log | tee output.log tee will duplicate stdout, printing it to both terminal and output.log. ...
0
votes
0answers
26 views

How to capture stderr and stdout and let them output [duplicate]

How to capture in bash - tee - both stderr and stdout and let them output to their default streams (i.e. stdout and stderr) ? Having this toy example script: $ cat e.sh #!/bin/bash echo ...
0
votes
1answer
59 views

How do I output stderr/stdout of my script to both a file and the console?

I'm using Amazon Linux and writing a script in bash. I want to output both stderr / stdout (preferably in the order that they occur) to a file as well as the console. However, this command isn't ...
2
votes
1answer
51 views

Unable to redirect stdout/stderr to log file [duplicate]

I have a script tmp.sh #!/bin/bash echo hello sleep 3 echo 3 I want to log the script running time (as well as script stdout) to a log file. user$ time ./tmp.sh >& log.tmp real 0m3....
1
vote
2answers
20 views

redirect the output of {time}

I am trying to benchmark a single request agains a webserver, and am having a problem doing so, specifically, I am having an issue redirecting the output of the time command. If i simply run time ...
0
votes
2answers
94 views

Redirect stdout to file with nohup doesn't work

I'm trying to run a C-program in the background. I also want to save the stdout-outputs of the program. But if I try the following, nohup only redirects stderr-outputs to the logfile.txt: nohup ./...
1
vote
2answers
34 views

I want to catch the STDERR and STDOUT of Background running script

I have to run a script background and also i have to catch the STDERR and STDOUT . i'm using the below line . test.sh & >> log_file 2>&1 But un fortunately nothing is getting ...
5
votes
3answers
583 views

sending output to /dev/stderr vs. >&2

In scripts, errors are usually sent to file descriptor 2 with &2, ie: echo "error" >&2 Sometimes /dev/stderr is used instead: echo "error" > /dev/stderr Looking at /dev/stderr, I ...
1
vote
1answer
98 views

`docker logs foo | less` isn't searchable or scrollable but `docker logs foo 2>&1 | less` is

Using either one gives readable text. But only with the stderr redirect can one scroll or type /somepattern and get matches. Without it searching gives "Nothing to search (press RETURN)" and a ...
4
votes
3answers
196 views

Trying to make sense of bash redirection syntaxes and their outputs

I'm new to Linux and trying to understand how redirections work. I have been testing various syntaxes for redirecting stdout and stderr to the same file, which don't all produce the same results. ...
1
vote
2answers
82 views

shell stderr to /dev/null

I have PID file and I want to get PID number so this is what I am doing. [root@linux ~]# PID=`cat /usr/local/foo/var/run/foo.pid` [root@linux ~]# echo $PID 3414 sometimes this file doesn't ...
1
vote
0answers
25 views

Suppress warning of rbenv versions if no rubies installed

At the moment I'm working on Ansible role that installs ruby with rbenv. In order not to install same ruby version every time I run setup task I have to check that no needed ruby is already installed. ...
7
votes
1answer
361 views

How can I pipe only stderr in zsh?

In bash: $ echo hi 2>&1 1>/dev/null | cat $ While in zsh: $ echo hi 2>&1 1>/dev/null | cat hi $ Is there a way to pipe only standard error while redirecting standard out?
7
votes
2answers
430 views

Redirecting standard error output to bash variable

Here's a C code snippet that will cause segfault: // segfault.c #include <string.h> int main() { memset((char *)0x0, 1, 100); return 1; } Compile it with: gcc segfault.c -o ...
2
votes
2answers
105 views

Output is in console but not part of stdout or stderr

I have a command that outputs the following: READY Listening.... HELLO READY Listening.... TEST It is speech recognition from pocketsphinx_continuous. I need that output redirected to a file, and ...
2
votes
3answers
37 views

What is regarded as “ideal” in relation to using stdout/stderr for output in different situations?

I have seen stdout and stderr used in a variety of different ways - as far as I understand, it is common to use stdout for general information and stderr for errors and the like. However, I have also ...
0
votes
2answers
477 views

how to redirect output of ssh to a file

I want to make ssh connection to my server but I don't want to enter password. I want to save output to a file like so: $ ssh root@x.x.x.x -p 22 1>output 2>&1 but when I run it the output ...
0
votes
0answers
110 views

Stop stdout log being clipped (by heroku-local)

I run heroku local with the Procfile: web: start-nginx gunicorn -c gunicorn.conf.py app:app start-nginx does some environment setup, and then ends with: { nginx --some-params & $@ ; } the ...
1
vote
2answers
142 views

Duplicate stdin to stdout and stderr, but in a synchronized way

I need to duplicate the stdout of a producer and feed it to two consumer in a synchronized fashion. consumer 1 producer | duplicator | consumer 2 ...
0
votes
2answers
892 views

How to redirect unzip -v output to a log file in shell script [duplicate]

I have a script that loops through all zip files in a large directory and individually unzips them. I am using the -q option in order to keep the console clean and display other monitoring info. I ...
0
votes
3answers
61 views

What is `>&` in simple terms? [duplicate]

What does $ command 1>&2 do? As I understand it this runs the command but with the STDOUT redirected to the STDERR. But I'm not sure exactly how >& works. I have seen it as $ command 1&...
2
votes
2answers
435 views

stderr gets flushed before stdout, when using file logger

My python code: import sys print "i am a daemon" print "i will be run using nohup" sys.stderr.write("i am an error message inside nohup process\n") When i run the code as python a.py, it shows, i ...
0
votes
3answers
746 views

Throw away standard output and error

I have redircted my ouput using /dev/null in bash script but it is still throwing an error. Code is following ps -p $proc | fgrep $proc> /dev/null if [ $? -ne '0' ] ; then ...... fi below is ...
4
votes
2answers
2k views

Inconsistency of stderr redirection between tcsh and other shells

I'm running into issues with redirection in tcsh. Consider the following commands: vi --version and vi --xxx. And let's assume this is on a machine where vi supports the --version option. The ...
1
vote
2answers
152 views

CSH and all output (with errors) to file

I need save all output from compilation to file. I have many errors "undefined reference" and I want see all of these errors. I try "makeall >& out", but in file "out" aren't any of error "...
4
votes
2answers
9k views

suppress stderr messages in a bash script

Consider the following (slightly silly) script name 'test1.sh': #/bin/bash # sleep 10 & echo sleep pid = $! pkill sleep When I run it, I get not only the output of the echo, but bash's ...
0
votes
1answer
919 views

Redirecting Standard Output And Standard Error to One File [duplicate]

I have come to understand that we have two methods of redirecting both stdout and stderr to the same file. The first method is: ls -l /bin > ls-output.txt 2>&1 As the author of this book ...
1
vote
1answer
128 views

capture log of ufsdump when backup to stdout

I am backing a file system with ufsdump. In order to gain space in the remote file system I backup to stdout then pipe the output to compress. I find is more efficient that backuping up and then ...
0
votes
2answers
202 views

How can I redirect the same message to both stdoud and stderr (without temporary object)

It is easy to redirect stdout or stderr to the same output (file or one of the 2 std output) with a 1>&1,>&2 and/or >file. Is there a way to send the same output to both the std ...
5
votes
3answers
7k views

Write to stderr

I'm using stderred to color all output streamed to stderr red. It's working fine. But when I write my own bash script and throw an error with echo 'error' 1>&2, it doesn't color the output in ...
1
vote
1answer
143 views

Using find -exec and having trouble with redirecting standard error

I have an individual.sh script that pipes standard error to a grep command, like this: FOUND=$(tesseract "$i" out -psm 0 |& grep -ci 'Orientation in degrees: [^0]') If I run the script like ...
2
votes
2answers
90 views

Output piped content to file and show number of lines in the file on stdout

I would like to use tee to pipe content from stdout and stderr respectively into files (in fact append it with > >(tee -a $filename)). However, instead of seeing the contents appended to the ...
4
votes
1answer
167 views

unexpected output with grep

I am using pyrit. For those who dont know, pyrit allows among other things to check if a wpa handshake key is valid: pyrit -r file0.cap analyze when a file does not contain a valid key, here is ...
5
votes
4answers
427 views

A command that generates both standard error and output

I want to do some troubleshooting on my bash script. Is there a short and simple command that generates both stdout and stderr so that I can use 2>&1 on it? Sorry if this looks trivial, but I ...
1
vote
2answers
5k views

How do I suppress a warning message?

touch ~/deleted/$(echo "directory_"$(readlink -f foo)|tr '/' '\') 2> /dev/null where foo is a directory It's reading the full pathname of foo and creating it as a file replacing all '/' with '\' ...
4
votes
0answers
37 views

Show error messages and information that a program was killed on another terminal [duplicate]

If I open a program, say evince, from the GNOME GUI, it is not attached to a terminal. If I send it a signal, it acts accordingly but nothing shows up in my terminal. If I were to open it in a ...
1
vote
0answers
16 views

Test execution output of a command before a pipe [duplicate]

I would like to test the execution of a php script that redirect its stdout and stderr to a file with tee. php /path/to/script --param 2>&1 | tee -a /path/to/log if ( test $? -ne 0 ); then ...
0
votes
2answers
574 views

How do I enable &>/dev/null by default for all sh/bash commands?

Is there a way to make &>/dev/null the default behavior in a sh/bash script? I' rather not have to appended this to every command within the console, not an *.sh script. I'm looking to make a ...
10
votes
2answers
3k views

stderr over ssh -t

This sends output to STDERR, but does not propagate Ctrl+C (i.e. Ctrl+C will kill ssh but not the remote sleep): $ ssh localhost 'sleep 100;echo foo ">&2"' This propagates Ctrl+C (i.e. Ctrl+...
5
votes
3answers
10k views

stdin, stderr, redirection and logs

Is there a difference between those two lines ? /home/user/script.sh >> /home/user/stdout_and_error.log 2>&1 /home/user/script.sh 2>&1 >> /home/user/stdout_and_error.log ...
2
votes
4answers
221 views

Can a running script identify the logging context?

Let us say I redirect the STDOUT, STDERR of a program to files. ./script.sh 1> output.log 2> error.log Can the running program find this out i.e. know the paths to these files?
1
vote
2answers
2k views

Redirect grep error output to file

I wanted to capture to a file the errors being returned on the command line from grep. For example, grep foo.lookup No such file in directory I want to output that to a log file. This is my shell ...
6
votes
1answer
271 views

Can redirecting stdout and stderr to the same file mangle lines?

I've read that when redirecting stdout and stderr to the same file using 2>&1, stdout is usually block buffered while stderr is unbuffered. If a very long line is written to stdout, requiring ...
3
votes
1answer
100 views

What is the relationship between a program's output, standard output, and its file descriptors?

Let's assume that I am running wget which is downloading something. It's printing some text to my terminal and writes the downloaded data into a file. From a terminology point of view, what is the ...