Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I execute bash script in eclipse the error output is written in red text. I have some behaviour in my code that is letting "user" know that error has occurred, how to make in error look like error?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

I haven't used eclipse for a while, but if I remember correctly, the console view uses red color for stderr.

If you want to execute your application and get red color for error messages, then print them to stderr instead of stdout.

share|improve this answer
how to do it in bash? i'm running bash script from eclipse (in eclipse console) –  UAdapter Nov 26 '11 at 13:52
You can redirect stdout to stderr in echo like this: echo "error message here" 1>&2. For more information, you can refer to the all about redirection article. –  jcollado Nov 26 '11 at 18:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.