Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

11
  • 2
    The question seems to assume that setting SHELL is mandatory: it is not. POSIX merely states how the variable is interpreted when set. As for "correct", that aspect makes the question opinion-based (it will only attract opinions). Commented Feb 17, 2016 at 9:12
  • 1
    The first half of the question is the problem. If it were only clarifying why make may use SHELL, that is straightforward. But the paragraph beginning "If it were only used", etc., undermines the question. Commented Feb 17, 2016 at 9:45
  • 2
    @JoachimBreitner, note that usually make variables are initialized from environment variables (look at a reference for the details), but SHELL is special in that respect (at least for gnu make), it isn't initialized that way. Commented Feb 17, 2016 at 12:29
  • 1
    $SHELL is the only environment variable that make is not allowed to import. This is because users could have a shell like csh that is not compatible. Commented Feb 17, 2016 at 13:44
  • 1
    BTW, rationale of system contains "One reviewer suggested that an implementation of system() might want to use an environment variable such as SHELL to determine which command interpreter to use. The supposed implementation would use the default command interpreter if the one specified by the environment variable was not available. This would allow a user, when using an application that prompts for command lines to be processed using system(), to specify a different command interpreter. Such an implementation is discouraged." Commented Feb 17, 2016 at 13:50