Re: sh(1) exec redirection

Mouse <[email protected]>
Newsgroups gmane.os.netbsd.devel.userlevel
Message-ID <[email protected]>
> After digging for hours why something like
> 	FOO_PASS_FD=3 exec /usr/pkg/bin/foo 3</path/to/pass
> worked on -6, but not on -8, I found out that [...]

I ran into something similar some time ago on, apparently, 8.0.  I
found - I forget where - a workaround.  To quote from the script:

# Misfeature in 8.0's sh(1): "exec N<thing" descriptors are not passed
#  to commands(!!).  Fortunately it provides a workaround: N>&N / N<&N.
exec 3</dev/rsd0d 3<&3

This may work for your use case too; I didn't try exec with a command.

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		[email protected]
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.