1 '\" Copyright (C) 1998-2023 Free Software Foundation, Inc.
3 '\" This is free software. You may redistribute copies of it under the terms
4 '\" of the GNU General Public License <https://www.gnu.org/licenses/gpl.html>.
5 '\" There is NO WARRANTY, to the extent permitted by law.
7 env \- run a program in a modified environment
9 .\" Add any additional description here
11 .SS "\-S/\-\-split\-string usage in scripts"
14 option allows specifying multiple parameters in a script.
15 Running a script named
17 containing the following first line:
21 #!/usr/bin/env \-S perl \-w \-T
27 .B "perl \-w \-T 1.pl".
31 parameter the script will likely fail with:
35 /usr/bin/env: 'perl \-w \-T': No such file or directory
39 See the full documentation for more details.
41 .SS "\-\-default-signal[=SIG]" usage
42 This option allows setting a signal handler to its default
43 action, which is not possible using the traditional shell
44 trap command. The following example ensures that seq
45 will be terminated by SIGPIPE no matter how this signal
46 is being handled in the process invoking the command.
51 sh \-c 'env \-\-default-signal=PIPE seq inf | head \-n1'
57 POSIX's exec(3p) pages says:
59 "many existing applications wrongly assume that they start with certain
60 signals set to the default action and/or unblocked.... Therefore, it is best
61 not to block or ignore signals across execs without explicit reason to do so,
62 and especially not to block signals across execs of arbitrary (not closely
63 cooperating) programs."
67 sigaction(2), sigprocmask(2), signal(7)