Paths in /etc/paths.d are not expanded. Can user home directories be supported?

Paths in /etc/paths.d are not expanded for all shells.

dotnet adds a /etc/paths.d/dotnet-cli-tools file that contains

~/.dotnet/tools

The ~/.dotnet/tools folder is used for tools that are 'global' across all projects for the same user.

The tilde is not expanded for zsh and executables installed to ~/.dotnet/tools will not be found via the PATH. $HOME/dotnet/tools is also not expanded. (There appears to be a difference with bash. bash does seem to expand the tilde but doesn't expand variables.)

The man page for path_helper says

Files in these directories should contain one path element per line.

The /etc/paths.d mechanism is great. Keeping installers out of a user's .profile/.zprofile/.zshrc/etc files is very helpful. But user home directory paths for the current user are not supported (at least not consistently across all shells) in the current implementation of path_helper and paths.d.

Not expanding paths might be by design or by omission but adding support for paths in the current user home would be useful.

Paths in /etc/paths.d are not expanded for all shells.

I encourage you to file a bug about this.

Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

A point of clarification: the behavior with bash is different because bash appears to interpret the tilde when using the PATH to locate a command.

Paths in /etc/paths.d are not expanded. Can user home directories be supported?
 
 
Q