File: envml.1

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