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

learn more… | top users | synonyms

1
vote
1answer
4 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
40 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 ...
2
votes
3answers
164 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
48 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
49 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
82 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 ...
4
votes
4answers
294 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
369 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
200 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 ...
8
votes
1answer
420 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. ...
5
votes
3answers
2k 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
109 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
855 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 ...
4
votes
1answer
138 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
79 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 ...
4
votes
1answer
7k views

nohup: ignoring input and redirecting stderr to stdout

I am starting my application in the background using nohup as mentioned below - root@phx5qa01c:/bezook# nohup java -jar ./exhibitor-1.5.1/lib/exhibitor-1.5.1-jar-with-dependencies.jar -c file ...
0
votes
0answers
17 views

nohup: ignoring input and redirecting stderr to stdout [duplicate]

I am starting my application in the background using nohup as mentioned below - root@phx5qa01c:/bezook# nohup java -jar ./exhibitor-1.5.1/lib/exhibitor-1.5.1-jar-with-dependencies.jar -c file ...
2
votes
2answers
79 views

Different error messages when using different strings in terminal

When I insert, for example, unix.stackexchange.com followed by Enter in terminal, I get the following error: unix.stackexchange.com: command not found This is ok and as I expected. But when I insert ...
1
vote
1answer
123 views

Pipe not picking up stdout

I am running a java program from a OS X 10.8 bash terminal, and are trying to rederect the output it is producing. However, when either running this throug a pipe, or rederecting it to a file, the ...
2
votes
1answer
44 views

aptitude produces output twice

For quite a while, I get a double output of some messages from aptitude. Here’s an example: > sudo aptitude install mpw Couldn't find package "mpw". However, the following packages contain "mpw" ...
7
votes
3answers
265 views

How to run a command while logging output to a file?

I have a console application that needs to be run as part of the deployment of a new application version on my server. This console application is designed to output to the console, and cannot be ...
5
votes
1answer
81 views

Is it possible to create sticky redirection from stdout/stderr

Consider such code: echo hello >> log.txt echo world >> log.txt I execute command with stdout redirection. Is it possible to create sticky redirection? Something like this: redir ...
2
votes
2answers
2k views

How can I filter those “Permission denied” from find output? [duplicate]

I started using sed recently. One handy way I use it is to ignore unimportant lines of a log file: tail -f example.com-access.log | sed '/127.0.0.1/d;/ELB-/d;/408 0 "-" "-"/d;' But when I try to ...
2
votes
1answer
80 views

Run a script when a process throws stderr message

I want to "wrap" a process around another to catch stderr messages when they occur. Use Case I'm using Compass and I have to have a terminal open and see if there is something wrong. My plan is to ...
12
votes
3answers
408 views

When to use redirection to stderr in shell scripts

I know that well-behaved utilities like grep output "normal" messages to stdout, and error messages to stderr. $ grep '^foo' file1 file2 file1:foo grep: file2: No such file or directory When I'm ...
8
votes
1answer
332 views

Output of command not in stderr nor stdout

I've stumbled on this issue, so I'm wondering how is this possible? Standard run of command: # zabbix_sender -c zabbix_agentd.conf -k mmysql.QCInserts -o 14 info from server: "Processed 0 Failed 1 ...
2
votes
2answers
80 views

redirecting std output and std error

I have been trying to figure out the relationship between file descriptors. One thing I don't understand is, how is: ls -l /bin/usr > ls-output.txt 2>&1 different from: ls -l /bin/usr ...
4
votes
3answers
3k views

Copy stdout and stderr to a log file and leave them on the console within the script itself

Using bash, how do I copy stderr and stdout to a log file and also leave them displayed on the console? I would like to do this within the script itself using an exec. I tried with exec ...
2
votes
1answer
163 views

Why is it possible to refer to a closed stderr under bash?

I'd like to know why bash doesn't display an error message when we refer to a closed stderr. When it comes to other file descriptors, they have to be opened if we want to, for example, duplicate them. ...
2
votes
1answer
122 views

Stderr of piped shell scripts isn't always displayed

I piped my own shell scripts for some testing and accidentally noticed something strange. Namely, the stderr of those piped processes isn't always displayed on the screen. I simplified the scripts ...
8
votes
2answers
2k views

Does `Segmentation fault` message come under STDERR?

I ran an executable in bash ./code > log It shows occasional error messages on terminal whereas all printf statements go into log file. I re-run it like below ./code >& log Now, the ...
2
votes
2answers
5k views

How to redirect error to a file?

I have this simple script which redirects the output and append it to a file. filename="/home/ronnie/tmp/hello" date=$(date) echo "$date" >> $filename Now, lets suppose I change date=$(date) ...
4
votes
2answers
290 views

Redirect stderr of the double-parentheses construct

I'd like to be able to redirect the stderr of a double-parentheses construct. For example: a=$(($var/$var2)) would output some error messages if $var2 = 0, I do not want the user to see this. I ...
3
votes
1answer
185 views

Why doesn't “cvs --help | less” work?

I don't know why, but piping cvs --help to less doesn't work. Probably it's because cvs --help outputs not to standard output(1) or error output(2), but somewhere else. Could you tell me where does it ...