2 # ksh-like `cd': cd [-LP] [dir [change]]
10 L|P) CDOPTS="$CDOPTS -$opt" ;;
11 *) echo "$FUNCNAME: usage: $FUNCNAME [-LP] [dir] [change]" >&2
16 shift $(( $OPTIND - 1 ))
19 0) builtin cd $CDOPTS "$HOME" ;;
20 1) builtin cd $CDOPTS "$@" ;;
24 *) echo "${0##*/}: $FUNCNAME: bad substitution" >&2 ; return 1 ;;
29 builtin cd $CDOPTS "$dir" && echo "$PWD"
32 *) echo "${0##*/}: $FUNCNAME: usage: $FUNCNAME [-LP] [dir] [change]" >&2