[Bug 233545] bin/sh: "export VAR" always defines VAR unlike other shells

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Nov 26 20:23:22 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=233545

            Bug ID: 233545
           Summary: bin/sh: "export VAR" always defines VAR unlike other
                    shells
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs at FreeBSD.org
          Reporter: jbeich at FreeBSD.org
                CC: jilles at FreeBSD.org

Created attachment 199580
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=199580&action=edit
v0 (blind backport)

I'm trying to build a project that conditionally defines variables but always
exports them. With FreeBSD sh those unset end up defined with empty value. If
make/gmake/etc is later invoked ?= assignments are ignored.

  $ env -i sh -c 'export CC; printenv' | fgrep CC
  CC=
  $ env -i sh -c 'export CC; make -V CC'

dash, pdksh, bash, zsh aren't affected. NetBSD sh fixed it in
https://github.com/netbsd/src/commit/9ad7f3a0e1b5

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list