XXX=-u env -v -u NAME -S '${XXX}\_NAME' drops core. I don't think it should drop core. That is reduced from a much longer expression, of course. --ksb
In myt testing these all drop core. env -S '\c' env -S '#' env -S '#ls\_NAME' env -u this -u this -S "#alas pwd" I found a few more, but you get the idea. Mayhap I'll try to fix it. --ksb
A commit references this bug: Author: jilles Date: Sun Mar 8 14:12:45 UTC 2015 New revision: 279779 URL: https://svnweb.freebsd.org/changeset/base/279779 Log: env: Fix crash when -S string is not empty but no operand follows. split_spaces() set argc in main() incorrectly, which caused trouble for getopt(). Examples: env -S '\c' env -S -i PR: 197769 MFC after: 1 week Changes: head/tools/regression/usr.bin/env/regress-env.rgdata head/tools/regression/usr.bin/env/regress-sb.rb head/usr.bin/env/envopts.c
A commit references this bug: Author: jilles Date: Sun Mar 15 11:43:52 UTC 2015 New revision: 280027 URL: https://svnweb.freebsd.org/changeset/base/280027 Log: MFC r279779: env: Fix crash when -S string is not empty but no operand follows. split_spaces() set argc in main() incorrectly, which caused trouble for getopt(). Examples: env -S '\c' env -S -i PR: 197769 Changes: _U stable/10/ stable/10/tools/regression/usr.bin/env/regress-env.rgdata stable/10/tools/regression/usr.bin/env/regress-sb.rb stable/10/usr.bin/env/envopts.c
A commit references this bug: Author: jilles Date: Sun Mar 15 11:56:53 UTC 2015 New revision: 280029 URL: https://svnweb.freebsd.org/changeset/base/280029 Log: MFC r279779: env: Fix crash when -S string is not empty but no operand follows. split_spaces() set argc in main() incorrectly, which caused trouble for getopt(). Examples: env -S '\c' env -S -i PR: 197769 Changes: _U stable/9/tools/regression/usr.bin/env/ stable/9/tools/regression/usr.bin/env/regress-env.rgdata stable/9/tools/regression/usr.bin/env/regress-sb.rb _U stable/9/usr.bin/env/ stable/9/usr.bin/env/envopts.c