home | list info | list archive | date index | thread index

[OCLUG-Tech] how does one test if bash shell is interactive

Is there a way for a bash script to test if it's being run from an
interactive shell? That is, I want to be able to test whether the
script was started as:

$ script

or as

$ script &

I looked at bash's shopt command and while it discusses 'interactive'
shells, I didn't see anything that allows me to test for the
condition.

regards,
Michael.