Bug 196513 - environ(7): please document the valid values of pathnames for SHELL, PAGER and EDITOR/VISUAL
Summary: environ(7): please document the valid values of pathnames for SHELL, PAGER an...
Status: RESOLVED DOCUMENTED
Alias: None
Product: Documentation
Classification: Unclassified
Component: man-pages (show other bugs)
Hardware: All Linux
: P1 enhancement
Assignee: Alejandro Colomar
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-28 07:06 UTC by Vincent Lefevre
Modified: 2021-01-19 20:51 UTC (History)
1 user (show)

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Vincent Lefevre 2017-07-28 07:06:35 UTC
The environ(7) man page http://man7.org/linux/man-pages/man7/environ.7.html says:

       SHELL  The pathname of the user's login shell.

       PAGER  The user's preferred utility to display text files.

       EDITOR/VISUAL
              The user's preferred utility to edit text files.

but doesn't say whether the pathnames must be absolute or they can be resolved using $PATH, or whether they can have options.

Note that at least for SHELL, this is not specified by POSIX. I've raised the issue in the Austin Group mailing-list, and the only answer I got is that "what constitutes a valid value for a platform should be documented":

  https://www.mail-archive.com/austin-group-l@opengroup.org/msg01399.html

Since at least one application (OpenSSH) assumes that $SHELL is an absolute pathname (when set), I suppose that the documentation should be:

       SHELL  The absolute pathname of the user's login shell.

For PAGER, POSIX says: "Any string acceptable as a command_string operand to the sh -c command shall be valid."

For EDITOR, it does not need to be an absolute pathname since POSIX gives the example:

  EDITOR=vi fc

and since it is specified as "the name of a utility", I assume that arguments (options) must not be provided. Page 3013 about "more", it is said: "If the last pathname component in EDITOR is either vi or ex, [...]", thus again, it is assumed to be a pathname.

For VISUAL, POSIX says: "Determine a pathname of a utility to invoke when the visual command [...]", thus it is also a pathname. It is not clear whether the pathname must be absolute, but for consistency with EDITOR, I assume that it will be resolved using $PATH.

Note: I had also reported this bug in the Debian BTS (with no comments yet):

  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=866060
Comment 1 Alejandro Colomar 2021-01-19 20:36:35 UTC
Hello Vincent,

I applied your patch (3 years later...).
I added a Signed-off-by field on your behalf,
and will forward it to Michael now.

Thanks for the report and the patch,

Alex
Comment 2 Alejandro Colomar 2021-01-19 20:40:11 UTC
[CC += Bastien]

On 1/19/21 9:36 PM, Alejandro Colomar (man-pages) wrote:
> Hello Vincent,
> 
> I applied your patch (3 years later...).
> I added a Signed-off-by field on your behalf,
> and will forward it to Michael now.
> 
> Thanks for the report and the patch,
> 
> Alex
> 

Oops sorry,
the patch is from Bastien now that I see.
I found it just in time!

Regards,

Alex

Note You need to log in before you can comment on or make changes to this bug.