[gull] Petit problème shell script

Daniel Cordey dc at mjt.ch
Tue Nov 11 17:26:02 CET 2003


On Tuesday 11 November 2003 17:09, Blaise Drayer wrote:

> En plus a première vue 5<&/dev/tty ne fonctionne pas

Voila pourtant la partie de la doc de bash qui explique cette fonctionalite. 
Il s'agit bien de DUPLICATION et pas de redirection.

Duplicating File Descriptors

 The redirection operator 

 [n]<&word 

 is used to duplicate input file descriptors. If word expands to one or more 
digits, the file descriptor denoted by n is made to be a copy of that file 
descriptor. If the digits in word do not specify a file descriptor open for 
input, a redirection error occurs. If word evaluates to -, file descriptor n 
is closed. If n is not specified, the standard input (file descriptor 0) is 
used. 

 The operator 

 [n]>&word 

 is used similarly to duplicate output file descriptors. If n is not 
specified, the standard output (file descriptor 1) is used. If the digits in 
word do not specify a file descriptor open for output, a redirection error 
occurs. As a special case, if n is omitted, and word does not expand to one 
or more digits, the standard output and standard error are redirected as 
described previously. 

Daniel




More information about the gull mailing list