#!/bin/bash TMP=$(mktemp) # Put the output to fd 4 and put the TUI to 2, since pipes redirect 1 by default cat /dev/stdin | select_option $TMP 1>&2 cat $TMP rm $TMP