I have two statements to return from ~/.bashrc
if the shell is not interactive, probably from two Ubuntu versions, but I can't reconstruct which one is newer (and I assume thus better) and I'm interested in the effect of the different approaches:
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
vs.
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
[[ $- == *i* ]] || return
– glenn jackman Aug 29 '18 at 15:45