Test for an interactive shell in Bash
if [[ -z $PS1 ]] # no prompt? ### if [ -v PS1 ] # On Bash 4.2+ ... then # non-interactive ... else # interactive ... fi