Use $ -
Do Manual de Referência do Bash :
To determine within a startup script whether or not Bash is running interactively, test the value of the ‘-’ special parameter. It contains i when the shell is interactive.
Para este exemplo,
$ bash -c 'echo $-' # This is a non-interactive shell
hBc
$ bash -i -c 'echo $-' # This is an interactive shell
himBHc