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
132
133
134
135
136
137
|
.\" Adapted for BNU from the GNU Coreutils 9.11 manual page; see doc/README.md.
.TH ENV "1" "2026-07-28" "BNU 9.11" "BNU Commands"
.SH NAME
env \- run a program in a modified environment
.SH SYNOPSIS
.B env
[\fI\,OPTION\/\fR]... [\fI\,-\/\fR] [\fI\,NAME=VALUE\/\fR]... [\fI\,COMMAND \/\fR[\fI\,ARG\/\fR]...]
.SH DESCRIPTION
.\" This page is derived from GNU Coreutils documentation.
This page documents BNU, an independent Bun implementation compatible with
GNU Coreutils 9.11.
.PP
Set each NAME to VALUE in the environment and run COMMAND.
.PP
Mandatory arguments to long options are mandatory for short options too.
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#env-a'\fB\-a, \-\-argv0=\,ARG\fP\X'tty: link'\/\fR
pass ARG as the zeroth argument of COMMAND
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#env-i'\fB\-i, \-\-ignore\-environment\fP\X'tty: link'
start with an empty environment
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#env-0'\fB\-0, \-\-null\fP\X'tty: link'
end each output line with NUL, not newline
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#env-u'\fB\-u, \-\-unset=\,NAME\fP\X'tty: link'\/\fR
remove variable from the environment
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#env-C'\fB\-C, \-\-chdir=\,DIR\fP\X'tty: link'\/\fR
change working directory to DIR
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#env-S'\fB\-S, \-\-split\-string=\,S\fP\X'tty: link'\/\fR
process and split S into separate arguments;
used to pass multiple arguments on shebang lines
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#env--block-signal'\fB\-\-block\-signal[=SIG]\fP\X'tty: link'
block delivery of SIG signal(s) to COMMAND
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#env--default-signal'\fB\-\-default\-signal[=SIG]\fP\X'tty: link'
reset handling of SIG signal(s) to the default
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#env--ignore-signal'\fB\-\-ignore\-signal[=SIG]\fP\X'tty: link'
set handling of SIG signal(s) to do nothing
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#env--list-signal-handling'\fB\-\-list\-signal\-handling\fP\X'tty: link'
list non default signal handling to standard error
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#env-v'\fB\-v, \-\-debug\fP\X'tty: link'
print verbose information for each processing step
.TP
\X'tty: link https://www.gnu.org/software/coreutils/env#env--help'\fB\-\-help\fP\X'tty: link'
display this help and exit
.TP
\X'tty: link https://www.gnu.org/software/coreutils/env#env--version'\fB\-\-version\fP\X'tty: link'
output version information and exit
.PP
A mere \- implies \fB\-i\fR. If no COMMAND, print the resulting environment.
.PP
SIG may be a signal name like 'PIPE', or a signal number like '13'.
Without SIG, all known signals are included. Multiple signals can be
comma\-separated. An empty SIG argument is a no\-op.
.SS "Exit status:"
.TP
125
if the env command itself fails
.TP
126
if COMMAND is found but cannot be invoked
.TP
127
if COMMAND cannot be found
.TP
\-
the exit status of COMMAND otherwise
.SH "SCRIPT OPTION HANDLING"
The
.B \-S
option allows specifying multiple arguments in a script.
Running a script named
.B 1.pl
containing the following first line:
.PP
.RS
.nf
#!/usr/bin/env \-S perl \-w \-T
\&...
.fi
.RE
.PP
Will execute
.B "perl \-w \-T 1.pl"
.PP
Without the
.B '\-S'
parameter the script will likely fail with:
.PP
.RS
.nf
/usr/bin/env: 'perl \-w \-T': No such file or directory
.fi
.RE
.PP
See the full documentation for more details.
.PP
.SH NOTES
POSIX's \fBexec\fP(3p) pages says:
.RS
"many existing applications wrongly assume that they start with certain
signals set to the default action and/or unblocked.... Therefore, it is best
not to block or ignore signals across execs without explicit reason to do so,
and especially not to block signals across execs of arbitrary (not closely
cooperating) programs."
.RE
.SH AUTHORS
Upstream GNU Coreutils documentation authors:
Written by Richard Mlynarik, David MacKenzie, and Assaf Gordon.
.br
Adapted for BNU; the BNU implementation is independent.
.SH "REPORTING BUGS"
Report BNU bugs at <https://github.com/Soccera1/bnu/issues>.
.br
For upstream GNU Coreutils, see <https://www.gnu.org/software/coreutils/>.
.SH COPYRIGHT
Copyright \(co 2026 Free Software Foundation, Inc.
.br
This manual page was adapted for BNU in 2026.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
.br
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
.SH "SEE ALSO"
\fBsigaction\fP(2), \fBsigprocmask\fP(2), \fBsignal\fP(7)
.PP
.br
Upstream documentation <https://www.gnu.org/software/coreutils/env>
.br
BNU documentation is available locally via: info \(aq(bnu) env invocation\(aq
|