When trying to redirect program output with the some number greater than syntax (eg foo 2> myfile), what are the possible numbers here and what do they represent?I believe 1 is /dev/stdout, 2 is /dev/stderr. What about 5 & 6? Is there 3, 4 or some number greater than 6?
Program output redirection
io redirection;file descriptors;fifo
This supposed program will write to file descriptor number you specified.consider the following hello world program:#include <stdio.h>main(){   ssize_t i = 0 ;   printf (hello world\n) ;   i = write( 5 , Bonjour Monde\n, 14 ) ;   printf (%d octet dans 5\n, (int) i) ;}compile itme@mybox:~/tmp7$ make hwcc     hw.c   -o hwnow a simple runme@mybox:~/tmp7$ ./hwhello world-1 octet dans 5no file for 5, so no byte wrote.next try:me@mybox:~/tmp7$ ./hw 5> uhello world14 octet dans 5me@mybox:~/tmp7$ cat uBonjour MondeI manage to get an output while specifying a file and a file descriptor (e.g. 5>u ).In practice, unless you have wrote such funny program as above, you are unlikely to collect data using 5>foo.in shell script, construct using <( ) are more usefull: diff <( cmd -par 1 ) <(cmd -par 2)