dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid

前端 未结 7 1691
遇见更好的自我
遇见更好的自我 2021-01-31 02:07

since an update to 10.8 I get the following error, when trying to do a sudo command, which is pretty annoying.

dyld: DYLD_ environment variables being ignored be         


        
7条回答
  •  伪装坚强ぢ
    2021-01-31 02:48

    In zsh:

    sudo () { ( unset LD_LIBRARY_PATH DYLD_LIBRARY_PATH; exec command sudo $* ) }
    

    This spawns a sub-shell in which the environment variables sudo complains about are unset, and then executes sudo (via exec so that the now-unecessary parent shell exits immediately).

    I'll leave it as an exercise to the reader to port to bash, et al.

提交回复
热议问题