man-pages/man1/env.1.html
2021-03-31 01:06:50 +01:00

148 lines
3.7 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of ENV</TITLE>
</HEAD><BODY>
<H1>ENV</H1>
Section: User Commands (1)<BR>Updated: September 2019<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
env - run a program in a modified environment
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>env</B>
[<I>,OPTION/</I>]... [<I>,-/</I>] [<I>,NAME=VALUE/</I>]... [<I>,COMMAND /</I>[<I>,ARG/</I>]...]
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<P>
Set each NAME to VALUE in the environment and run COMMAND.
<P>
Mandatory arguments to long options are mandatory for short options too.
<DL COMPACT>
<DT id="1"><B>-i</B>, <B>--ignore-environment</B><DD>
start with an empty environment
<DT id="2"><B>-0</B>, <B>--null</B><DD>
end each output line with NUL, not newline
<DT id="3"><B>-u</B>, <B>--unset</B>=<I>,NAME/</I><DD>
remove variable from the environment
<DT id="4"><B>-C</B>, <B>--chdir</B>=<I>,DIR/</I><DD>
change working directory to DIR
<DT id="5"><B>-S</B>, <B>--split-string</B>=<I>,S/</I><DD>
process and split S into separate arguments;
used to pass multiple arguments on shebang lines
<DT id="6"><B>-v</B>, <B>--debug</B><DD>
print verbose information for each processing step
<DT id="7"><B>--help</B><DD>
display this help and exit
<DT id="8"><B>--version</B><DD>
output version information and exit
</DL>
<P>
A mere - implies <B>-i</B>. If no COMMAND, print the resulting environment.
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
<A NAME="lbAF">&nbsp;</A>
<H3>-S/--split-string usage in scripts</H3>
The
<B>-S</B>
option allows specifing multiple parameters in a script.
Running a script named
<B>1.pl</B>
containing the following first line:
<P>
<DL COMPACT><DT id="9"><DD>
<PRE>
#!/usr/bin/env -S perl -w -T
</PRE>
</DL>
<P>
Will execute
<B>perl -w -T 1.pl.</B>
<P>
Without the
<B>'-S'</B>
parameter the script will likely fail with:
<P>
<DL COMPACT><DT id="10"><DD>
<PRE>
/usr/bin/env: 'perl -w -T': No such file or directory
</PRE>
</DL>
<P>
See the full documentation for more details.
<A NAME="lbAG">&nbsp;</A>
<H2>AUTHOR</H2>
Written by Richard Mlynarik, David MacKenzie, and Assaf Gordon.
<A NAME="lbAH">&nbsp;</A>
<H2>REPORTING BUGS</H2>
GNU coreutils online help: &lt;<A HREF="https://www.gnu.org/software/coreutils/">https://www.gnu.org/software/coreutils/</A>&gt;
<BR>
Report env translation bugs to &lt;<A HREF="https://translationproject.org/team/">https://translationproject.org/team/</A>&gt;
<A NAME="lbAI">&nbsp;</A>
<H2>COPYRIGHT</H2>
Copyright &#169; 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later &lt;<A HREF="https://gnu.org/licenses/gpl.html">https://gnu.org/licenses/gpl.html</A>&gt;.
<BR>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
<A NAME="lbAJ">&nbsp;</A>
<H2>SEE ALSO</H2>
Full documentation at: &lt;<A HREF="https://www.gnu.org/software/coreutils/env">https://www.gnu.org/software/coreutils/env</A>&gt;
<BR>
or available locally via: info '(coreutils) env invocation'
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="11"><A HREF="#lbAB">NAME</A><DD>
<DT id="12"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="13"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="14"><A HREF="#lbAE">OPTIONS</A><DD>
<DL>
<DT id="15"><A HREF="#lbAF">-S/--split-string usage in scripts</A><DD>
</DL>
<DT id="16"><A HREF="#lbAG">AUTHOR</A><DD>
<DT id="17"><A HREF="#lbAH">REPORTING BUGS</A><DD>
<DT id="18"><A HREF="#lbAI">COPYRIGHT</A><DD>
<DT id="19"><A HREF="#lbAJ">SEE ALSO</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:11 GMT, March 31, 2021
</BODY>
</HTML>