#!/usr/bin/env bash echo $- [[ $- == *i* ]] && echo 'Interactive' || echo 'Not interactive' read -p 'press [ENTER] to continue deleting line' < /dev/tty if test -t 1; then echo stdout else echo NO fi read -p "Answer?: " echo $REPLY