diff options
author | Eric Blake <ebb9@byu.net> | 2009-10-26 13:32:49 -0600 |
---|---|---|
committer | Eric Blake <ebb9@byu.net> | 2009-10-26 21:30:34 -0600 |
commit | f00bbe33e41a9849351ea57c2706516d43e1e98d (patch) | |
tree | 1b8e228f7451a6624970850f97c5473f45957e79 /doc/coreutils.texi | |
parent | 0f3f6bf6bf38f1ed9c85fe98d6ac7645bf10a6c3 (diff) | |
download | coreutils-f00bbe33e41a9849351ea57c2706516d43e1e98d.tar.xz |
tests: clean up tests of env -- handling
The comment in env.c about -- handling has not matched the behavior
in the code since the initial commit back in 1992.
* src/env.c: Fix bogus comment.
* tests/misc/env: Further tweaks, avoiding PATH problems inherent
in testing -i, and testing program name containing =.
* doc/coreutils.texi (env invocation): Mention that intermediate
program is needed to invoke program with name containing =.
Diffstat (limited to 'doc/coreutils.texi')
-rw-r--r-- | doc/coreutils.texi | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi index 8a79ba7fb..138cf0184 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -14413,6 +14413,20 @@ Modifications to @env{PATH} take effect prior to searching for not portable when @env{PATH} is undefined or omits key directories such as @file{/bin}. +In the rare case that a utility contains a @samp{=} in the name, the +only way to disambiguate it from a variable assignment is to use an +intermediate command for @var{command}, and pass the problematic +program name via @var{args}. For example, if @file{./prog=} is an +executable in the current @env{PATH}: + +@example +env prog= true # runs 'true', with prog= in environment +env ./prog= true # runs 'true', with ./prog= in environment +env -- prog= true # runs 'true', with prog= in environment +env sh -c '\prog= true' # runs 'prog=' with argument 'true' +env sh -c 'exec "$@@"' sh prog= true # also runs 'prog=' +@end example + @cindex environment, printing If no command name is specified following the environment |