My question is, is there a way to make an executable file in
$PATHhave preference over an shell builtin, by executing only, e.g.cdwithout builtin or command?
Você pode usar o enable incorporado para desabilitar / habilitar um arquivo incorporado. Diga:
enable -n cd
para desativar o cd incorporado. Diga enable cd para ativar o builtin.
O seguinte daria um exemplo de alternar entre o builtin e o comando:
$ type cd
cd is a shell builtin
$ enable -n cd
$ type cd
-bash: type: cd: not found
$ enable cd
$ type kill
kill is a shell builtin
$ enable -n kill
$ type kill
kill is /bin/kill
$ enable kill
$ type kill
kill is a shell builtin