: Dear comp.unix.shell readers,
: The question is a straight forward one. How does
: one send to standard error from a shell script?
: All the echo's and print's and such go to standard
: What I would like is for my own shell script warning
: messages to be sent to standard error and not JUST echo'ed
: to the user.
: Thank you.
echo "This is an error" 2> error.file
Standard in is file descriptor 0
Standard out is file descriptor 1
Standard error is file descriptor 2, thus the 2> above
Or, you can set up the script to trace all functions, including errors and
all step as they occure, with shell substitutions with:
exec 2> /tmp/sh.err
A the begining of the shell script.
URL: http://www.celestial.com One Mercer Plaza, Suite S100
Mercer Island, WA 98040; (206) 236-1676
Manufacturer of InterRack (Internet-in-a-Rack), a full turn-key
system, including all the hardware, software, installation, setup, training
and support for businesses and Internet Service Providers