[bug #61309] Bad rule evaluation when SHELL variable contains environment variables

2021-10-08 Thread anonymous
URL:
  

 Summary: Bad rule evaluation when SHELL variable contains
environment variables
 Project: make
Submitted by: None
Submitted on: Fri 08 Oct 2021 09:59:57 AM UTC
Severity: 3 - Normal
  Item Group: Bug
  Status: None
 Privacy: Public
 Assigned to: None
 Open/Closed: Open
 Discussion Lock: Any
   Component Version: 4.3
Operating System: POSIX-Based
   Fixed Release: None
   Triage Status: None

___

Details:

When the SHELL variable contains environment variables, multi-line rules
(broken with backslash) are processed line by line.

For


SHELL = FOO=BAR sh

all:
@echo hello \
world


this results in the following erroneous output


hello \
/bin/sh: 2: world: not found


Removing the environment variable from the SHELL variable


SHELL = sh

all:
@echo hello \
world


produces the expected output:


hello world


.ONESHELL doesn't seem to help in this case.



___

File Attachments:


---
Date: Fri 08 Oct 2021 09:59:57 AM UTC  Name: Makefile  Size: 265B   By: None



___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[bug #61309] Bad rule evaluation when SHELL variable contains environment variables

2022-09-02 Thread nervo
Follow-up Comment #1, bug #61309 (project make):

Have you tried to prefix SHELL command with `env` ?

SHELL = env FOO=BAR sh

```
all:
@echo hello \
world
```

It seems to work around the issue :)


___

Reply to this item at:

  

___
Message posté via Savannah
https://savannah.gnu.org/