I've written a program in ruby called citeselect
that uses curses to dynamically select a reference from a bibtex bibliogrpahy. I would like to put this program into a pipeline to cite anything easily using the output of this program. Unfortunately, as I found out from
Ncurses and linux pipeline (c),
Curses uses stdout
for its display.
Therefore, I've routed the output citation key into file descriptor 3 when it is provided as an output. I've verified that it works:
citeselect 3>output
Is there any way to capture the output sent to fd3
in a one liner in bash? Something like
echo "The citation key is $(citeselect 3>)"
Thanks.