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

learn more… | top users | synonyms

2
votes
4answers
72 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
83 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
73 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
58 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 ...
2
votes
1answer
1k 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
16 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
58 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
83 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
34 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
216 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
62 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 ...
12
votes
3answers
293 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 ...
2
votes
2answers
343 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
57 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 ...
8
votes
1answer
204 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
64 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
2answers
1k 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
109 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 ...
2
votes
1answer
101 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. ...
7
votes
2answers
1k 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
1k 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
216 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
152 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 ...