execline
Software
skarnet.org
The >& program
>& moves or copies a given file descriptor, then
executes a program.
Interface
>& [ -c ] fdto fdfrom prog...
>& moves the file descriptor number fdfrom,
to number fdto, then execs into prog with its arguments.
If fdto is open, >& closes it before moving
fdfrom to it.
Options
- -c : duplicate fdfrom to fdto
instead of moving it; do not close fdfrom.
Notes
- >& -c a b prog... is roughly equivalent to
sh -c 'exec prog... a>&b'
- >& a b prog... is roughly equivalent to
sh -c 'exec prog... a>&b b<&-'