I just updated Cygwin and the new .bashrc contains this line right at the top:
echo "BEFORE TEST"
# If not running interactively, don't do anything
[[ "$-" != *i* ]] && return
echo "AFTER TEST"
I understand if not running interactive, you don't need to do anything, but my problem is that if I ssh with a command:
ssh localhost pwd
I see this:
BEFORE TEST
So, obviously, it fails the [[ "$-" != *i* ]] test and returns. Obviously ssh localhost pwd is a trivial example, but I expect .bashrc to be run all the way through if running a command through ssh. My actual automation runs commands remotely against this cygwin instance and is failing because the path (which is set by my .bashrc) is not getting set correctly.
Furthermore, can anyone explain what that test is actually doing? What is i? What is $- supposed to represent?