LucasLarson/dotfiles

`cd` is a `builtin` not a `command`

LucasLarson opened this issue · 2 comments

[ -n "${HOME}" ] && command cd -- "${HOME}" || exit 1


builtin cd

@ianmiell, Learn Bash the Hard Way: Master Bash Using The Only Method That Works

List of SDF’s Zsh builtins (which should be Venn diagrammed against the POSIX shell’s – union only):

-              let
.              limit
:              local
\[             log
alias          logout
autoload       noglob
bg             popd
bindkey        print
break          printf
builtin        private
bye            pushd
cd             pushln
chdir          pwd
command        r
compadd        read
comparguments  readonly
compcall       rehash
compctl        return
compdescribe   sched
compfiles      set
compgroups     setopt
compquote      shift
compset        source
comptags       suspend
comptry        test
compvalues     times
continue       trap
declare        true
dirs           ttyctl
disable        type
disown         typeset
echo           ulimit
echotc         umask
echoti         unalias
emulate        unfunction
enable         unhash
eval           unlimit
exec           unset
exit           unsetopt
export         vared
false          wait
fc             whence
fg             where
float          which
functions      zcompile
getln          zformat
getopts        zle
hash           zmodload
history        zparseopts
integer        zregexparse
jobs           zstat
kill           zstyle

On a POSIX-compliant OS, cd is both a builtin and a command, but

buitlin cd

is what this instance needs.
unix.stackexchange.com/a/38819