On Fri, May 13, 2005 at 11:39:42PM +0200, Marc Lehmann wrote:
> The following three commands work as expected:
> 
>    2>/tmp/x echo
>    echo 2>/tmp/x
>    echo 12>/tmp/x
> 
> However, this doesn't:
> 
>    12>/tmp/x echo
>    sh: 12: not found
> 
> It seems that dash has problems with redirections at the beginning of a
> command, but only when the fd is >= 10, smaller fd's seem to work fine.
> 
> I *think* this is a bug, but couldn't quite prove it (chapter 2 of susv3
> is a mess...). However, bash seems to have no problems with it, so it
> seems it would be sane behaviour to allow this redirection.

Hi Marc, I don't think this is a bug in dash.  From
http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_07

 Open files are represented by decimal numbers starting with zero. The
 largest possible value is implementation-defined; however, all
 implementations shall support at least 0 to 9, inclusive, for use by the
 application.

dash support file descriptors 0 to 9.

 $ echo 2>/tmp/x
 
 $ cat /tmp/x
 $ echo 2>/tmp/x
 $ echo 12>/tmp/x
 $ cat /tmp/x
 12
 $ 

Regards, Gerrit.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to