ignore `$SHELL` in `shellify`
Summary:
Why `$SHELL` is a bad idea:
- getenv() is not thread safe. (In practice it should work if other threads aren't calling setenv(), but still seems undesirable if we can avoid it.)
- It seems confusing for the program to have different behavior for different developers.
- Other shells besides /bin/sh may have different quoting behaviors. For instance, I don't think csh allows unescaped newlines inside single quotes.
- SHELL might be set to other non-shell-like programs in some cases. (Say, if this gets run from inside a git or mercurial hook it might end up being set to the restricted git or hg shell that only lets you run specific commands.)
Anyway, this isn't related to your diff, so nothing needs to be done for now,
but I would vote for changing this to always use /bin/sh in a future diff.
Both the C system() call and python's subprocess module appear to
always use /bin/sh and ignore $SHELL.
Reviewed By: simpkins
Differential Revision:
D3867047
fbshipit-source-id:
dab0e6afbe1c20ff13d9a52f212df95af425dd77