> Date: Mon, 28 Oct 2024 22:17:31 -0000 (UTC) > From: chris...@astron.com (Christos Zoulas) > > In article <20241028113037.b6b31f...@cvs.netbsd.org>, > Kimmo Suominen <source-changes-d@NetBSD.org> wrote: > >Implement "env -C dir" to chdir > > > >Use err(3) to expose errno(2) if chdir(2) (or unsetenv(3)) fails. > > We should just start from the FreeBSD copy I think because it has more > features.
I'm not sure that `more features' is good... Some of these options are very clearly within the scope of env(1) and worthwhile, like -u -- it already has a way to set one variable, or to clear all variables, just not to clear one variable. -0 is reasonably necessary for the output to be reliable in all environments even if variables have embedded newlines. In contrast, processing /etc/login.conf (-L/-U) is not clearly a reasonable thing for a basic unprivileged tool like this to have baked into it. Having a special-purpose string formatter (-S) with substitutions strikes me as bizarre (why not just use printf or vis?). I'm having a hard time imagining where alternate path searching is important to bake into env(1) and not just into the caller, e.g. by doing `env -u PATH $(PATH=/altpath which foo) ...'.