aboutsummaryrefslogtreecommitdiff
path: root/man/env.1
diff options
context:
space:
mode:
authorSoccera1 <[email protected]>2026-07-28 16:08:14 +1000
committerSoccera1 <[email protected]>2026-07-28 16:08:48 +1000
commit9846f087eb28bf11df740675ef487657ded39b69 (patch)
treee91dbd19b524f9432da6bcb86b1fc193e0d02e26 /man/env.1
parent7fa396c9ef22b32a0b05e94aaa0266dd3e7515f8 (diff)
parent6a2f098e72e71437154ec00506e8e736aa8e1026 (diff)
downloadbnu-9846f087eb28bf11df740675ef487657ded39b69.tar.gz
bnu-9846f087eb28bf11df740675ef487657ded39b69.zip
Merge branch 'master' into refactor/single-call-commandsrefactor/single-call-commands
# Conflicts: # README.md
Diffstat (limited to 'man/env.1')
-rw-r--r--man/env.1137
1 files changed, 137 insertions, 0 deletions
diff --git a/man/env.1 b/man/env.1
new file mode 100644
index 0000000..1063fdf
--- /dev/null
+++ b/man/env.1
@@ -0,0 +1,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