On 2022-04-25 at 17:32:50 +0100, Mike Cloaked via arch-general <arch-general@lists.archlinux.org> wrote:
On Mon, Apr 25, 2022 at 4:56 PM Frank via arch-general < arch-general@lists.archlinux.org> wrote:
#add Perl and Perl modules to file path export PATH="$(PATH):/usr/bin/core_perl/" export PATH="$(PATH):/usr/bin/vendor_perl/" export PATH="$(PATH):/usr/bin/site_perl/"
This looks wrong. This would presumably try to change the path three times and only store the last one - but even that looks wrong.
That's the right construct, but as someone else pointed out, the parentheses should be braces. The idea is that for desired each element in PATH, there's exactly one line of code. It's easy to copy/paste a new one or delete an old one, and it makes for clean/cleaner diffs.
PATH=$PATH:/usr/bin/core_perl:/usr/bin/vendor_perl:/usr/bin/site_perl
If I do that, and decide that I don't want vendor_perl anymore, then I have to edit (carefully!) the middle of that line, and that (the standard line-oriented) diff will show me only a monolithic before/after picture. In the OP's scheme, I can delete one complete line, and diff will show very clearly what I deleted. (I'm not claiming that your scheme is unworkable, or that text editors or other tools are incapable of assisting. I am claiming that the OP's scheme has its advantages and is definitely not wrong, modulo the curly braces.)