| 1 |
.\" Man page generated from reStructuredText |
| 2 |
.\" by the Docutils 0.22.4 manpage writer. |
| 3 |
. |
| 4 |
. |
| 5 |
.nr rst2man-indent-level 0 |
| 6 |
. |
| 7 |
.de1 rstReportMargin |
| 8 |
\\$1 \\n[an-margin] |
| 9 |
level \\n[rst2man-indent-level] |
| 10 |
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] |
| 11 |
- |
| 12 |
\\n[rst2man-indent0] |
| 13 |
\\n[rst2man-indent1] |
| 14 |
\\n[rst2man-indent2] |
| 15 |
.. |
| 16 |
.de1 INDENT |
| 17 |
.\" .rstReportMargin pre: |
| 18 |
. RS \\$1 |
| 19 |
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] |
| 20 |
. nr rst2man-indent-level +1 |
| 21 |
.\" .rstReportMargin post: |
| 22 |
.. |
| 23 |
.de UNINDENT |
| 24 |
. RE |
| 25 |
.\" indent \\n[an-margin] |
| 26 |
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] |
| 27 |
.nr rst2man-indent-level -1 |
| 28 |
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] |
| 29 |
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u |
| 30 |
.. |
| 31 |
.TH "ENVML" "1" "2026-09-21" "5.7.0" "Modules" |
| 32 |
.SH NAME |
| 33 |
envml \- run a command in an environment setting up by Modules |
| 34 |
.SH SYNOPSIS |
| 35 |
.sp |
| 36 |
\fBenvml\fP [\fIMODULE_ACTION\fP]... [\-\-] \fICOMMAND\fP [\fIARG\fP]... |
| 37 |
.SH DESCRIPTION |
| 38 |
.sp |
| 39 |
The \fBenvml\fP command configures the environment using specified |
| 40 |
Environment Modules actions and then given command. |
| 41 |
.sp |
| 42 |
This is useful for running a command in a modified environment without |
| 43 |
permanently altering the current shell session. |
| 44 |
.sp |
| 45 |
\fBenvml\fP interprets its first arguments as module actions, then |
| 46 |
switches to command execution after either encountering \fB\-\-\fP or determining |
| 47 |
that the remaining arguments form the actual command to run. |
| 48 |
.SH MODULE_ACTION FORMAT |
| 49 |
.sp |
| 50 |
Each module action argument can be one of the following forms: |
| 51 |
.INDENT 0.0 |
| 52 |
.IP \(bu 2 |
| 53 |
\fBpurge\fP |
| 54 |
Unload all currently loaded modulefiles. |
| 55 |
.IP \(bu 2 |
| 56 |
\fBrestore[=coll]\fP |
| 57 |
Restore the module environment from the named collection \fBcoll\fP\&. If no |
| 58 |
name is given, restores the default collection. |
| 59 |
.IP \(bu 2 |
| 60 |
\fBunload=mod1[&mod2...]\fP |
| 61 |
Unload one or more specified modulefiles. |
| 62 |
.IP \(bu 2 |
| 63 |
\fBswitch=mod1&mod2\fP |
| 64 |
Unload \fBmod1\fP and load \fBmod2\fP\&. |
| 65 |
.IP \(bu 2 |
| 66 |
\fB[load=]mod1[&mod2...]\fP |
| 67 |
Load one or more specified modulefiles. \fBload=\fP can be omitted. |
| 68 |
.UNINDENT |
| 69 |
.sp |
| 70 |
Multiple MODULE_ACTIONs can be passed in a single argument using the colon |
| 71 |
(\fB:\fP) separator. The ampersand (\fB&\fP) is used to specify multiple modules |
| 72 |
in a single action. |
| 73 |
.SH COMMAND EXECUTION |
| 74 |
.sp |
| 75 |
Everything following the \fB\-\-\fP separator is treated as the command to execute |
| 76 |
in the modified environment. |
| 77 |
.sp |
| 78 |
If no \fB\-\-\fP separator is provided, \fBenvml\fP assumes the first |
| 79 |
argument is a MODULE_ACTION and the remaining arguments form the command to |
| 80 |
execute. |
| 81 |
.SH OPTIONS |
| 82 |
.INDENT 0.0 |
| 83 |
.TP |
| 84 |
.B \-\-help, \-h |
| 85 |
Display usage information and exit. |
| 86 |
.UNINDENT |
| 87 |
.SH EXAMPLES |
| 88 |
.sp |
| 89 |
Restore default module collection then run \fBcommand arg1 arg2\fP: |
| 90 |
.INDENT 0.0 |
| 91 |
.INDENT 3.5 |
| 92 |
.sp |
| 93 |
.EX |
| 94 |
envml restore command arg1 arg2 |
| 95 |
.EE |
| 96 |
.UNINDENT |
| 97 |
.UNINDENT |
| 98 |
.sp |
| 99 |
Purge all modules, then load \fBmod1\fP and \fBmod2\fP, and run the command: |
| 100 |
.INDENT 0.0 |
| 101 |
.INDENT 3.5 |
| 102 |
.sp |
| 103 |
.EX |
| 104 |
envml purge:mod1:mod2 command arg1 arg2 |
| 105 |
.EE |
| 106 |
.UNINDENT |
| 107 |
.UNINDENT |
| 108 |
.sp |
| 109 |
Use the \fB\-\-\fP separator to avoid ambiguity: |
| 110 |
.INDENT 0.0 |
| 111 |
.INDENT 3.5 |
| 112 |
.sp |
| 113 |
.EX |
| 114 |
envml restore load=mod1&mod2 \-\- command arg1 arg2 |
| 115 |
.EE |
| 116 |
.UNINDENT |
| 117 |
.UNINDENT |
| 118 |
.SH EXIT STATUS |
| 119 |
.sp |
| 120 |
The \fBenvml\fP command returns the exit status of the executed command |
| 121 |
or \fB1\fP if module action fails. |
| 122 |
.SH DIAGNOSTICS |
| 123 |
.sp |
| 124 |
If the \fBmodule\fP command is not available in the shell (i.e., not a |
| 125 |
shell function), \fBenvml\fP will print an error and exit. |
| 126 |
.SH SEE ALSO |
| 127 |
.sp |
| 128 |
module \%<#\:module-1>, modulecmd \%<#\:modulecmd-1>, ml \%<#\:ml-1>, modulefile \%<#\:modulefile-5> |
| 129 |
.SH Copyright |
| 130 |
1996-2026, Modules Contributors |
| 131 |
.\" End of generated man page. |