0

This question already has an answer here:

If I invoke

DYLD_X=foo /bin/bash -c 'echo "<$DYLD_X>"'

the output is

<>

while

MY_VAR=bar /bin/bash -c 'echo "<$MY_VAR>"'

outputs

<bar>

Switching to Bash 5:

DYLD_X=foo /usr/local/bin/bash -c 'echo "<$DYLD_X>"'

the output is

dyld: warning, unknown environment variable: DYLD_X
<foo>

I would think that dyld should only monitor variables that it knows about. Is there anything that can be done to control this behavior?

MacOS Mojave 10.14.4

marked as duplicate by Mark, nohillside Apr 25 at 13:52

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Macos does not like dyld variables the latest versions use sip and remove them. What are you trying to do – Mark Apr 25 at 13:24
  • @Mark: I'm just trying to understand why this seemingly odd behavior occurs. – Dennis Williamson Apr 25 at 13:26
  • Basically Apple thinks it is insecure a way of injected unfriendly code into normal apps – Mark Apr 25 at 13:32