Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

env

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
env [OPTION]... [-] [NOM=VALEUR]... [COMMANDE [ARG]...]

Définir chaque NOM à VALEUR dans l’environnement et exécuter COMMANDE

Options

--ignore-environment, -i

start with an empty environment

--chdir=<DIR>, -C <DIR>

change working directory to DIR

--null, -0

end each output line with a 0 byte rather than a newline (only valid when printing the environment)

--quoting-style

Set quoting style

--env0-from=<FILE>

read NUL-delimited environment entries from FILE

--unset=<NAME>, -u <NAME>

remove variable from the environment

--debug, -v

print verbose information for each processing step

--split-string=<S>, -S <S>

process and split S into separate arguments; used to pass multiple arguments on shebang lines

--argv0=<a>, -a <a>

Override the zeroth argument passed to the command being executed. Without this option a default value of command is used.

--ignore-signal=<SIG>

set handling of SIG signal(s) to do nothing

--default-signal=<SIG>

reset handling of SIG signal(s) to the default action

--block-signal=<SIG>

block delivery of SIG signal(s) while running COMMAND

--list-signal-handling

list signal handling changes requested by preceding options

Un simple - implique -i. Si aucune COMMANDE, afficher l’environnement résultant.

Examples

Affiche l’environnement :

env

Exécute le programme donné. Souvent utilisé dans les scripts après le shebang (#!) pour consulter le chemin vers le programme :

env {{programme}}

Exécute le programme donné, avec un environnement vide :

env -i {{programme}}

Supprime une variable d’environnement et execute le programme donné :

env -u {{variable}} {{programme}}

Définit ou modifie une variable d’environnement et execute le programme donné :

env {{variable}}={{valeur}} {{programme}}

Définit ou modifie plusieurs variables d’environnement et execute le programme donné :

env {{variable1}}={{valeur}} {{variable2}}={{valeur}} {{variable3}}={{valeur}} {{programme}}

The examples are provided by the tldr-pages project under the CC BY 4.0 License.

Please note that, as uutils is a work in progress, some examples might fail.