[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [leafnode-list] leafnode-1.9.5b4



Bruno Rohee <br@xxxxxxxxxx> wrote:
> Attached is the output of 
> % (./configure ; make ) 2>1 >/tmp/log
..
> Strangely the warning were lost...

Possibility 1: you indeed typed "2>1".  That redirects standard error
(file descriptor 2) into a file named "1" (that's a legal UNIX file
name, after all) in the current directory.  To dup a file descriptor
into another one for output purposes, the Bourne shell syntax is ">&".
Here, that would be "2>&1".

Possibility 2: you actually typed "2>&1".  If so, you put the
redirections in the wrong order.  The shell processes them
left-to-right one at a time.  First, it did
    2>&1
That made standard error point to the *current* file descriptor 1,
which is your terminal.  *Then* it did
    >/tmp/log
which redirected standard output to that file but did not affect the
previous change to standard error.

If you had instead done
    >/tmp/log 2>&1
then it would have worked.  The first one would have redirected
standard output, and "2>&1" would have pointed standard error at the
*new* standard output, /tmp/log.  All the output would have gone to
/tmp/log.

It's precisely the difference between
    b = a;
    a = 23;
and
    a = 23;
    b = a;
Only in the latter case are b and a guaranteed to be the same and both
be 23.

-- 
                    *** NEW PERSONAL ADDRESS ***
Tim McDaniel is tmcd@xxxxxxxx; if that fail,
    tmcd@xxxxxxxxxxxxxx and tmcd@xxxxxxxxxx are my work accounts.
    tmcd@xxxxxxx is old and will go away.

-- 
leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list