Skip to content

Commit de5052b

Browse files
committed
doc: desc. newline char support in env var value
Signed-off-by: Xavier Delaruelle <[email protected]>
1 parent e1cb80f commit de5052b

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

NEWS.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,12 @@ Modules 5.6.0 (not yet released)
132132
* Issue the *nearly-forbidden* warning at the end of the affected modulefile
133133
evaluation, ensuring it is always reported at the same stage regardless of
134134
where it is defined.
135+
* Change underlying shell code to set environment variable on *sh*, *bash*,
136+
*ksh*, *zsh* and *fish* shells: enclose value within single quotes rather
137+
escaping each special characters.
138+
* :mfcmd:`setenv` modulefile command now supports environment variable value
139+
containing newline character. Exception is made for *csh* and *tcsh* shells
140+
where newline characters are chopped from value. (fix issue #557)
135141

136142
.. _Security policy: https://github.com/envmodules/modules/blob/main/SECURITY.md
137143
.. _Modules chat room: https://matrix.to/#/#modules:matrix.org

doc/source/changes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,6 +1151,9 @@ The following modulefile Tcl commands appeared on Modules 5.
11511151
Starting with version ``5.1``, the ``--set-if-undef`` option is added to set
11521152
environment variable when modulefile is loaded only if not yet defined.
11531153

1154+
Starting with version ``5.6``, value set can contain newline character.
1155+
Exception for csh shell family where such character is chopped from value.
1156+
11541157
:mfcmd:`source-sh`
11551158

11561159
Starting Modules ``5.1``, this modulefile command also tracks shell

doc/source/modulefile.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,11 +1452,16 @@ the *modulefile* is being loaded.
14521452
When the ``--set-if-undef`` option is set, environment variable is defined
14531453
when *modulefile* is loaded only if not yet defined.
14541454

1455+
Any newline character in *value* is chopped if using *csh* or *tcsh* shells.
1456+
14551457
.. only:: html
14561458

14571459
.. versionchanged:: 5.1
14581460
Option ``--set-if-undef`` added
14591461

1462+
.. versionchanged:: 5.6
1463+
Newline character in value supported except for *csh* and *tcsh* shells
1464+
14601465
.. mfcmd:: source-sh [--ignore eltlist] shell script [arg...]
14611466

14621467
Evaluate with *shell* the designated *script* with defined *arguments* to

0 commit comments

Comments
 (0)