<<< Date Index >>>     <<< Thread Index >>>

Re: [PATCH] when using `which` send errors to /dev/null



On Thu, May 24, 2007 at 07:57:45AM +0100, David Laight wrote:
> On Wed, May 23, 2007 at 10:55:25PM +0100, Luciano Rocha wrote:
> > 
> >  } 3>&2 > /dev/null 2>&1 (or 3>&2 &> /dev/null) should work instead.
> 
> Except that &> isn't posix-compliant shell syntax (it is from csh), and
> isn't supported by all shells.

I didn't know that, thanks.

> 
> Also, since the redirection of {...} will enforce a subshell (at least
> on some shells), requesting it explicitly by using (...) is better.

But then, the var assignment will be lost.

> Also a conformat posix shell should have a 'type' command, and 'command -v'
> which are builtins that report the location of programs.

tcsh has shipped in Fedora Core 6 doesn't support any of those two
commands.

$ tcsh --version
tcsh 6.14.00 (Astron) 2005-03-25 (i386-intel-linux) options
wide,nls,dl,al,kan,rh,color,filec

-- 
lfr
0/0

Attachment: pgpxPZ682D0Pv.pgp
Description: PGP signature