bin/39198: sh aborts on variables with periods

Jens Schweikhardt schweikh at FreeBSD.org
Sat Jul 24 05:15:12 PDT 2004


Synopsis: sh aborts on variables with periods

State-Changed-From-To: open->closed
State-Changed-By: schweikh
State-Changed-When: Sat Jul 24 12:13:13 GMT 2004
State-Changed-Why: 
The discussion has settled on using a different test method
to detect the shell incarnation. No need to change /bin/sh.

BTW, this is what I use for years and has never let me down:
if test -n "${ZSH_VERSION}"; then
    _SHELL=zsh
elif test -n "${BASH_VERSION}"; then
    _SHELL=bash
elif test -n "${FCEDIT}"; then
    _SHELL=ksh
elif test "${PS3}" = ""; then
    _SHELL=sh
else
    _SHELL=unknown
fi

http://www.freebsd.org/cgi/query-pr.cgi?pr=39198


More information about the freebsd-bugs mailing list