Quote:
Originally Posted by Nathanael
this basically turns 1 and 2 arround: now only error messages are in 'test' and no other output
in bash you have 9 descriptors (and google-ing for descriptors and bash usually gets you some nice tutorials)
1 is reserved for stdout
2 is reserved for stderr
3-9 are not reserved
after (cat xxx 3>&2 2>&1 1>&3) your have 1 = stderr and 2 = stdout, but only outside of the brackets.
|
Hi Nathanael,
Thanx alot for ur valuable inputs.
correct me if i m wrong in saying that
1.when we execute command like ..file 2>&1 , it does mean report output & error(if any) in same file .
2.Now here, let me break entire expression in three parts
3>&2 -- Does it mean output value to be placed where error vals r placed?..
2>&1 -- Does it mean error vals to be place where stdout vals r placed?..
1>&3 -- Does it mean stdout vals r placed where out vals r placed i.e. in turn output to be placed where errors are placed ?..
3. What is the significance of File Descriptors i.e. 3-9 in normal sense ?.
How do they act as out/in/error descriptor ?..
or their behaviour depends on the context in which they have been used?..
I may sound sound naive in asking aforesaid questions, but i need clarification.
Looking forward to hear from you.