4 ms·
If I unknowingly named my command the same as some system command and the custom command ends up earlier in my path it doesn't really cause any problems does it
by Timpy 4y ago
If I unknowingly named my command the same as some system command and the custom command ends up earlier in my path it doesn't really cause any problems does it? I wasn't using that system command anyways, and my custom command is only going to take priority if my .bashrc file was run first.
- xigoi 4y agoUntil you use a different machine and accidentally type your command without realizing it's not there.
- Taywee 4y agoIt can if you are executing programs that then try to execute those commands and get your commands instead.
- nerdponx 4y agoI wish it was easier to create "snapshots" of a particular set of environment variables in order to use them later as run environments. I also wish that Unix desktop environments generally made it easier to manage env vars, but that's another complaint. And don't get me started on PAM env vars...
- OJFord 4y agoJust env vars? env > "$(date +s).env-snapshot" (And use it again slightly more awkwardly as <$file | xargs -I@ echo '"@"' | tr '\n' ' ' | xargs -I@ env @ cmd or something more convenient to `cmd`.)
- fragmede 4y agohttps://direnv.net/ https://direnv.net/
- nerdponx 4y agoI use Direnv in all of my projects, but it doesn't make it any easier to manage consistent groups of env vars or assign different executables to run in different groups.
- verrp 4y ago> I wish it was easier to create "snapshots" of a particular set of environment variables in order to use them later as run environments. docker gives you this (but only as part of a whole ecosystem, which for various reasons you might not want to hitch your horse to).
- LanternLight83 4y agoDirenv has been mentioned, and it meshes well with functional package managers like Nix and Guix, each of which include the concept of "Profiles". Each profile can access a specific set of programs via it's environment, but PATH is far from the last variable that you can use Direnv or Profiles to control.
- tasuki 4y agoYes, all of that. And if you later decide to start using the system command, you just rename your custom command.