4 ms·
Ok think this through. I have to edit a variable by appending to a string. That makes no sense! I should have a simple command to prevent syntax errors! Mor
by h_tbob 3y ago
Ok think this through. I have to edit a variable by appending to a string. That makes no sense! I should have a simple command to prevent syntax errors!
More importantly, how do you ensure that you can easily access the new one? For example lets say I am installing python. How do I easily set the python3 binary? With the system I propose, you simply run
linpath info python3
>>>output
/usr/bin/python3
/opt/homebrew/python3.10/etc/bin/python3
/opt/homebrew/python3.11/etc/bin/python3
This would tell me exactly which python3 executable I'm using, but also it would also allow me to set my favorite one:
linpath select python3
... shows a dialog where i can choose 1,2,3 etc.
The nicest thing about this that you can't emulate with PATH is this: How do you have a simple list of all know locations of this binary? This would be so freaking useful when running multiple versions of "node" for example.
You know what? I was thinking that we could also do this for compatibility:
linpath search
Then what it would do is search for all binaries on the system (i.e. executable files), and create it's own database. Then it could have a flag in the database that certain ones are not "registered", but when you try to run them, it echos "this command is available at /path/to/executable" but hasn't been linked. To link run `linpath activate binary_name`.
Lastly, how is the installer to know where to update the PATH? .zshrc, .bash_profile, the systemwide one... So hard to understand!
So probably the linpath should have a systemwide database, and a user specific database as well maybe.
I'm not trying to argue, I just see so many shortcomings to PATH, specifically, the installer never knows what file to update, and it's not even available in cron jobs either. This can be remedied, but not without trouble! I think linux is great, but it's such a nerdy platform, I want to make it easier.
- warrenm 3y ago>Ok think this through. I have to edit a variable by appending to a string. That makes no sense! I should have a simple command to prevent syntax errors! "That makes no sense" Except ... it does and it has for over half a century
- warrenm 3y ago>Then what it would do is search for all binaries on the system (i.e. executable files), and create it's own database. Then it could have a flag in the database that certain ones are not "registered", but when you try to run them, it echos "this command is available at /path/to/executable" but hasn't been linked. To link run `linpath activate binary_name`. You ... just described updatedb and locate Don't want to use the binary in $PATH? Give the full path to the one you want
- warrenm 3y ago>I'm not trying to argue Except ... you are - what you're describing just is not efficient Maybe you've grown accustomed to the Windows Registry - are you also familiar with all the problems it has (vs the rock-solid, impossible to break environment variable)? >I just see so many shortcomings to PATH, specifically, the installer never knows what file to update, and it's not even available in cron jobs either. Of course an install can "know what file to update" - because it's not a file! It can put (if appropriate) a symlink to the executable into a normal location used by $PATH, or it can create its own environment variables for when it runs Or - as a last resort - it could update $PATH (a generally-bad idea, but still possible)
- h_tbob 3y agoRegarding the registry, I was under the impression you have to update the PATH on windows as well. I have tried dinking with it, and without updating the path, the command line can't find the proper programs. Am I missing something?
- warrenm 3y agoSome commandline tools references the registry Some do not