Or you could do this:
This results in both standard out and standard err being routed to /dev/null from that point on in the script.
Here are other examples of this type of redirection:
exec 3> file3.txt # now file descriptor 3 is writing to file3.txt
exec 4< file3.txt # now file descriptor 4 is reading from file3.txt
Some of this is courtesy of an ancient book I have called "The Unix Shell Programming Language" by Manis and Meyer. It's an old favorite of mine, and this syntax is still current.
Last edited by vrmartin2; 01-12-2010 at 06:55 AM.
Reason: syntax correction