On Tuesday 18 June 2002 03:02 pm, Arvind wrote:
> | Arvind wrote:
> | >  su - $amavisuser /usr/sbin/amavisd >/dev/null 2>&1
> | >
> | >
> | > what does 2 > &1 mean here actually
> |
> | this is called shell redirecting.
> | "2>&1" makes the shell redirect STDERR to STDOUT.
> | whcih is going to /dev/null
>
> but what 2 stand for and why &1 , why not just 1 ?

Those numbers are file descriptors. Usually, FD 0 is stdin, FD 1 is stdout,
and FD 2 is stderr. 2>&1 means redirect output that comes on FD 2
to FD 1 (which is being redirected to /dev/null).

2>1 makes all output go to a file called 1 rather than the descriptor.

With a knowledge of FDs and bash's exec builtin, you can do pretty
nifty things in shell scripts.

Binand


----------------------------------------------------------------------------
                   Bringing you mounds of caffeinated joy
                      >>>     http://thinkgeek.com/sf    <<<

_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to