Implement environment variable substitution for unix platforms

I want to be able to use this to redirect the bazel config file based
on the environment, for integration with our existing
environment-based mechanisms for selecting build configurations.

I found some opinions in comments which said this was too difficult,
which I have amended.

Closes #7318.

PiperOrigin-RevId: 237467945
diff --git a/site/docs/guide.html b/site/docs/guide.html
index a393989..b1af89a 100644
--- a/site/docs/guide.html
+++ b/site/docs/guide.html
@@ -858,11 +858,15 @@
   <li>
     Unless the <code class='flag'>--nosystem_rc</code> is present, Bazel looks for
     the system .bazelrc file: on Unix, it lives at <code>/etc/bazel.bazelrc</code>,
-    and on Windows at <code>%%ProgramData%%/bazel.bazelrc</code>.
+    and on Windows at <code>%ProgramData%/bazel.bazelrc</code>.
 
     If another system-specified location is required, this value can be
     changed by setting <code>BAZEL_SYSTEM_BAZELRC_PATH</code> in
     <code>src/main/cpp:option_processor</code> and using this custom Bazel binary.
+
+    The system-specified location may contain environment variable
+    substitutions, as <code>%var_name%</code> on Windows
+    or <code>${var_name}</code> on Unix.
   </li>
   <li>
     Unless the <code class='flag'>--noworkspace_rc</code> is present, Bazel looks