Re: find 'cd'
Steve Rikli <[email protected]> Thu, 16 Jul 2026 07:08:06 -0700
| Newsgroups | gmane.os.netbsd.general |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Jul 16, 2026 at 04:42:52PM +0700, Robert Elz wrote: > Date: Thu, 16 Jul 2026 09:32:47 +0200 > From: [email protected] > > | Ash Brad explained, it can't be an external program, > | and therefore it never was. > > Actually, POSIX used to require that there be one. So some > systems would have had such a thing. Yup. E.g. today FreeBSD still has a few things like $ cat /usr/bin/cd #!/bin/sh # This file is in the public domain. builtin ${0##*/} ${1+"$@"} A few others, like /usr/bin/umask, are similar. Some Linuxes have it too, e.g. Red Hat-flavored Alma Linux 9 has $ cat /usr/bin/cd #!/usr/bin/sh builtin cd "$@" > As has been explained, > it was useless, but it met some bizarre philosophy of how any > shell builtin utilities were to be located, in case some user > wanted to create their own version of the builtin to replace > it - which almost (but not really) makes some sense for things > like echo, printf, test, etc - even true & false - but it makes > no sense at all for things like cd, umask, ulimit, wait, ... > > POSIX finally woke up (a little) in the more recent (2024) version > of the standard, and requiring there to be a filesystem version > of absoutely every shell (non-special) builtin has gone now.