
3 Apr
2002
3 Apr
'02
10:26 p.m.
?? you seem to assume that the redirection affects the executing shell itself, whereas, IMO, it only affects the command. so, if the shell can't find the command, no redirection, and the shell reports the error as usual, no?
There seems to be a difference between bash and sh - the former behaves as I would like, the latter as you describe.
Under sh, something like if (basename >/dev/null 2>&1); then echo foo; fi will hide the shell's stderr. Jon