In a way this question is a extension of another question.
In bash you can do pretty neat stuff with file descriptors. Like
{ command > /dev/null } 2>&1 | grep filter;
to grep on stderr only.
My Question[s]:
- How many levels of descriptors are there. ( How high can the "numbers" go) ?
- Appart from
1
and2
( which are stdout and stderr ), what is the meaning and general use of those other "numbers"? - Is the order in which they are specified important?
e.g.command 1>&2 3>&1 2>&3
versuscommand 2>&3 3>&1 1>&2
1
is stdout;0
is stdin. – Gilles 'SO- stop being evil' Nov 02 '10 at 18:080
stdin is news to me :) I learnt something +1 – Stefan Nov 02 '10 at 20:36