#
# 2d [ - | + ] | [ cmd ... ]
#
# @(#)2d (AT&T Bell Laboratories) 06/22/93
#
# 2d start 2d shell
# 2d - disable 2d [ enable 3d ]
# 2d + enable 2d [ disable 3d ]
# 2d cmd run cmd in 2d
#
function _2d
{
option=$(vpath /#option/3d 2>/dev/null)
case $option in
?*) trap "set +o noglob; vpath \$option; export LD_PRELOAD='$LD_PRELOAD' _RLD_LIST='$_RLD_LIST' _RLDN32_LIST='$_RLDN32_LIST'" 0 INT QUIT
vpath - /#option/2d
;;
esac
set +o noglob
if test -d .
then case $1 in
-|+) case $1 in
+) option="- /#option/2d" ;;
-) option="- /#option/3d" ;;
esac
return
;;
esac
# this is close: ^A can't appear in $@
typeset IFS=''
unset __ LD_PRELOAD _RLD_LIST
case $1 in
[-+]*) $SHELL $@ ;;
*) ${@-$SHELL} ;;
esac
else print -u2 . not found
return 1
fi
}