+
+# By default .bashrc is sourced for ALL ssh commands. This is wonky.
+# Normally, this file is not sourced when a script is run, but we can
+# override that by sourcing ~/.bashrc. I want the same thing for ssh
+# commands. when a local script runs an ssh command, bashrc should not be
+# sourced, unless we use a modified command.
+#
+# So, in my bashrc, test for conditions of noninteractive ssh and return
+# if so. And we don't keep the rest of the code in .bashrc, because
+# even though we return, we parse the whole file which can cause errors
+# as we develop it.
+#
+# To test for an overriding condition: bash builtin vars and env show no
+# difference in ssh vs local, except shell level which is not
+# reliable. one option is to use an environment variable. env variables
+# sent across ssh are strictly limited. We could override an obscure
+# unused LC_var, like telephone, but I don't want to run into some edge
+# case where that messes things up. I choose to set SendEnv and
+# AcceptEnv ssh config vars to allow the environment variable BRC to
+# propagate across ssh, and for hosts I don't control, I start an inner
+# shell with it set, which doubles up as a way to have a nondefault
+# bashrc.