bash:check_if_bash_is_running_in_interactive_mode
This is an old revision of the document!
BASH - Check if bash is running in interactive mode
if [[ $- == *i* ]] then do_interactive_stuff fi
NOTE: According to man bash:
- PS1 is set and $- includes i if bash is interactive, allowing a shell script or a startup file to test this state.
bash/check_if_bash_is_running_in_interactive_mode.1612435119.txt.gz · Last modified: 2021/02/04 10:38 by peter