writing about PATH is so funny, it's like

1. just add “PATH=$PATH:/my/dir" to your shell config, no big deal
2. ok but uh also you need to worry about path ordering, maybe it has to be `PATH=/my/dir:$PATH` instead
3. oh also bash sometimes caches PATH lookups, so if that happens then you need to run `rehash`
4. oh yeah and also if there are spaces in your PATH, then you need to quote it every time you add to it, like `PATH=/my/dir:”$PATH”`
5. also sometimes commands are aliases or builtins

Follow

@b0rk

And if you have a directory with a colon in its path (a totally legit character for filenames), you are screwed.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.