#!/usr/bin/env bash echo $- [[ $- == *i* ]] && echo 'Interactive' || echo 'Not interactive' read -p "Answer?: " echo $REPLY