$ foobar
sh: foobar: not found
$ foobar 2>/dev/null
$
I'm trying to redirect only foobar's stderr (if foobar exists and can be run), but the shell's error message get redirected too. This happens in bash, ksh and sh, but not in csh. I'm not familiar with bourne shell source code, but I guess this happens because the shell first forks, then redirects, then tries exec(), and when exec() fails it sends an error message to stderr that has already been redirected.