1751691 Members
4733 Online
108781 Solutions
New Discussion юеВ

Re: Echo to StdErr

 
Seth Hollist
Occasional Advisor

Echo to StdErr

How could I use and echo or print statement from within a shell script to send information to Standard Error instead of Standard Out?

Thanks.
There's always room for improvment
2 REPLIES 2
S.C. Fun
Advisor

Re: Echo to StdErr

hi,
use >&2 in your script.

For e.g.
script file: test1.sh
echo "This is a std error." >&2

Good luck.
Rgds,
S.C. Fun
Seth Hollist
Occasional Advisor

Re: Echo to StdErr

I found my answer here:

Thanks.

http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0x97601012aa92d5118ff10090279cd0f9,00.html
There's always room for improvment