···11691169echo @foo@
11701170</programlisting>
1171117111721172- That is, no substitution is performed for undefined variables.</para></listitem>
11721172+ That is, no substitution is performed for undefined variables.</para>
11731173+11741174+ <para>Environment variables that start with an uppercase letter are filtered out,
11751175+ to prevent global variables (like <literal>HOME</literal>) from accidentally
11761176+ getting substituted.
11771177+ The variables also have to be valid bash “names”, as
11781178+ defined in the bash manpage (alphanumeric or <literal>_</literal>, must not
11791179+ start with a number).</para>
11801180+ </listitem>
11731181 </varlistentry>
1174118211751183
+1
pkgs/build-support/substitute/substitute-all.nix
···2233args:
4455+# see the substituteAll in the nixpkgs documentation for usage and constaints
56stdenv.mkDerivation ({
67 name = if args ? name then args.name else baseNameOf (toString args.src);
78 builder = ./substitute-all.sh;
+1-1
pkgs/stdenv/generic/setup.sh
···445445446446 # Select all environment variables that start with a lowercase character.
447447 # Will not work with nix attribute names (and thus env variables) containing '\n'.
448448- for envVar in $(env | sed -e $'s/^\([a-z][^=]*\)=.*/\\1/; t \n d'); do
448448+ for envVar in $(set | sed -e $'s/^\([a-z][^=]*\)=.*/\\1/; t \n d'); do
449449 if [ "$NIX_DEBUG" = "1" ]; then
450450 echo "$envVar -> ${!envVar}"
451451 fi