News for hackers. Stuff that matters.
Re:The bash book to rule them all by khrbtxyz on Wednesday November 08, 2023 @02:51AM (#38187782)

  $ uname
  Darwin
  $ which cd
  /usr/bin/cd
Re:The bash book to rule them all by traceroute66 on Wednesday November 08, 2023 @02:55AM (#38187810)
Huh ? Which OS X are you on ?

What you posted is not reproducable on Ventura (13.6)

    % uname 
    Darwin
    % which cd
    cd: shell built-in command
Re:The bash book to rule them all by irishsultan on Wednesday November 08, 2023 @02:58AM (#38187821)
Depends on your shell, if you execute `which -a cd` it will show you /usr/bin/cd in addition to the built-in command.

(zsh has which as a built in command, apparently bash doesn't, which causes the different output). It's unclear to me what /usr/bin/cd actually accomplishes though, even in bash.

(final edit I hope, I found an explanation of sorts for /usr/bin/cd: https://unix.stackexchange.com/a/50060)

Re:The bash book to rule them all by traceroute66 on Wednesday November 08, 2023 @03:07AM (#38187860)
> It's unclear to me what /usr/bin/cd actually accomplishes though, even in bash.

Seems to be something they adopted from FreeBSD if the comment in the script is anything to go by ? (`/usr/bin/cd` is a shell script, you can cat it).

It seems something to do with it being a POSIX system if this SO answer[1] is anything to go by.

Beyond my paygrade though, and given Apple's shell appears to default to the built-in it seems I don't need to care either. :-)

[1] https://unix.stackexchange.com/questions/50022/why-cant-i-re...

Re:The bash book to rule them all by khrbtxyz on Wednesday November 08, 2023 @03:17AM (#38187916)
I’m on Ventura 13.6.1. Looks like your which is a shell built-in as well. Try

  ls /usr/bin/cd