Post AluViMmhg3cFOAaDZI by miah@hachyderm.io
(DIR) More posts by miah@hachyderm.io
(DIR) Post #AluViL9Jl0W6Jj9FXU by b0rk@social.jvns.ca
2024-09-11T18:47:54Z
0 likes, 0 repeats
writing about PATH is so funny, it's like1. just add “PATH=$PATH:/my/dir" to your shell config, no big deal2. ok but also you need to worry about path ordering, maybe it has to be `PATH=/my/dir:$PATH` instead3. oh also bash sometimes caches PATH lookups, so if that happens then you need to run `rehash`4. also if it's a cron job it'll use a different PATH5. also if you `source` scripts into your shell config, it can get really difficult to track down PATH modificationsetc
(DIR) Post #AluViM0qXzKozkBzyS by jlargentaye@mas.to
2024-09-11T18:54:11Z
0 likes, 0 repeats
@b0rk “I’m sorry you’re in a windowing environment? Different PATH again”
(DIR) Post #AluViMmhg3cFOAaDZI by miah@hachyderm.io
2024-09-11T19:14:23Z
0 likes, 0 repeats
@jlargentaye @b0rk I think understanding that 'every new invocation of bash is a new set of possible variables' is one of the hard parts too.The 'invocation' section of the bash man page is filled with deep lore, magic, and knowledge.This is why cron jobs possibly have a different path.variable quoting _always_ gets me, even though its mostly automatic at this point. Good to code bash with shellcheck nearby.
(DIR) Post #AluViNewQP086NxX6m by jlargentaye@mas.to
2024-09-11T20:49:01Z
0 likes, 1 repeats
@miah @b0rk The Bash init file sequence is a nightmare. I assume (to their credit) that it is for compatibility reasons (ain’t that always so?)Years ago I drew a diagram to make sense of it, and show my boss why it was so crazy. And I still have it!(It’s a transparent PNG from OmniGraffle, apologies if you’re on a dark background)