tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: sh(1) exec redirection



> 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		mouse%rodents-montreal.org@localhost
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index