argument precedence, output redirection

2010-12-03 Thread Payam Poursaied
Hi all, I'm not sure this is a bug or please let me know the concept: What is the difference between: ls -R /etc/ 2>&1 1>/dev/null and ls -R /etc/ 1>/dev/null 2>&1 the second one redirect everything to /dev/null but the first one, still prints errors (run as a non root user would unveil the prob

Re: argument precedence, output redirection

2010-12-03 Thread Marc Herbert
Le 03/12/2010 14:46, Payam Poursaied a écrit : > > Hi all, > I'm not sure this is a bug or please let me know the concept: > What is the difference between: > ls -R /etc/ 2>&1 1>/dev/null > and > ls -R /etc/ 1>/dev/null 2>&1 > > the second one redirect everything to /dev/null but the first one,

Re: argument precedence, output redirection

2010-12-03 Thread Chet Ramey
> I'm not sure this is a bug or please let me know the concept: > What is the difference between: > ls -R /etc/ 2>&1 1>/dev/null > and > ls -R /etc/ 1>/dev/null 2>&1 > > the second one redirect everything to /dev/null but the first one, still > prints errors (run as a non root user would unveil

Re: argument precedence, output redirection

2010-12-03 Thread Eric Blake
On 12/03/2010 07:46 AM, Payam Poursaied wrote: > > Hi all, > I'm not sure this is a bug or please let me know the concept: > What is the difference between: > ls -R /etc/ 2>&1 1>/dev/null > and > ls -R /etc/ 1>/dev/null 2>&1 POSIX requires that redirections are evaluated from left to right. The

Re: argument precedence, output redirection

2010-12-03 Thread Greg Wooledge
On Fri, Dec 03, 2010 at 06:16:06PM +0330, Payam Poursaied wrote: > What is the difference between: > ls -R /etc/ 2>&1 1>/dev/null > and > ls -R /etc/ 1>/dev/null 2>&1 http://mywiki.wooledge.org/BashFAQ/055 In a sentence, redirections are done in order, from left to right.

argument precedence, output redirection

2010-12-03 Thread Payam Poursaied
Hi all, I'm not sure this is a bug or please let me know the concept: What is the difference between: ls -R /etc/ 2>&1 1>/dev/null and ls -R /etc/ 1>/dev/null 2>&1 the second one redirect everything to /dev/null but the first one, still prints errors (run as a non root user would unveil the pro